aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-omp.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-01-14 16:56:44 +0100
committerMartin Liska <mliska@suse.cz>2022-01-17 22:12:04 +0100
commit5c69acb32329d49e58c26fa41ae74229a52b9106 (patch)
treeddb05f9d73afb6f998457d2ac4b720e3b3b60483 /gcc/c-family/c-omp.c
parent490e23032baaece71f2ec09fa1805064b150fbc2 (diff)
downloadgcc-5c69acb32329d49e58c26fa41ae74229a52b9106.zip
gcc-5c69acb32329d49e58c26fa41ae74229a52b9106.tar.gz
gcc-5c69acb32329d49e58c26fa41ae74229a52b9106.tar.bz2
Rename .c files to .cc files.
gcc/ada/ChangeLog: * adadecode.c: Moved to... * adadecode.cc: ...here. * affinity.c: Moved to... * affinity.cc: ...here. * argv-lynxos178-raven-cert.c: Moved to... * argv-lynxos178-raven-cert.cc: ...here. * argv.c: Moved to... * argv.cc: ...here. * aux-io.c: Moved to... * aux-io.cc: ...here. * cio.c: Moved to... * cio.cc: ...here. * cstreams.c: Moved to... * cstreams.cc: ...here. * env.c: Moved to... * env.cc: ...here. * exit.c: Moved to... * exit.cc: ...here. * expect.c: Moved to... * expect.cc: ...here. * final.c: Moved to... * final.cc: ...here. * gcc-interface/cuintp.c: Moved to... * gcc-interface/cuintp.cc: ...here. * gcc-interface/decl.c: Moved to... * gcc-interface/decl.cc: ...here. * gcc-interface/misc.c: Moved to... * gcc-interface/misc.cc: ...here. * gcc-interface/targtyps.c: Moved to... * gcc-interface/targtyps.cc: ...here. * gcc-interface/trans.c: Moved to... * gcc-interface/trans.cc: ...here. * gcc-interface/utils.c: Moved to... * gcc-interface/utils.cc: ...here. * gcc-interface/utils2.c: Moved to... * gcc-interface/utils2.cc: ...here. * init.c: Moved to... * init.cc: ...here. * initialize.c: Moved to... * initialize.cc: ...here. * libgnarl/thread.c: Moved to... * libgnarl/thread.cc: ...here. * link.c: Moved to... * link.cc: ...here. * locales.c: Moved to... * locales.cc: ...here. * mkdir.c: Moved to... * mkdir.cc: ...here. * raise.c: Moved to... * raise.cc: ...here. * rtfinal.c: Moved to... * rtfinal.cc: ...here. * rtinit.c: Moved to... * rtinit.cc: ...here. * seh_init.c: Moved to... * seh_init.cc: ...here. * sigtramp-armdroid.c: Moved to... * sigtramp-armdroid.cc: ...here. * sigtramp-ios.c: Moved to... * sigtramp-ios.cc: ...here. * sigtramp-qnx.c: Moved to... * sigtramp-qnx.cc: ...here. * sigtramp-vxworks.c: Moved to... * sigtramp-vxworks.cc: ...here. * socket.c: Moved to... * socket.cc: ...here. * tracebak.c: Moved to... * tracebak.cc: ...here. * version.c: Moved to... * version.cc: ...here. * vx_stack_info.c: Moved to... * vx_stack_info.cc: ...here. gcc/ChangeLog: * adjust-alignment.c: Moved to... * adjust-alignment.cc: ...here. * alias.c: Moved to... * alias.cc: ...here. * alloc-pool.c: Moved to... * alloc-pool.cc: ...here. * asan.c: Moved to... * asan.cc: ...here. * attribs.c: Moved to... * attribs.cc: ...here. * auto-inc-dec.c: Moved to... * auto-inc-dec.cc: ...here. * auto-profile.c: Moved to... * auto-profile.cc: ...here. * bb-reorder.c: Moved to... * bb-reorder.cc: ...here. * bitmap.c: Moved to... * bitmap.cc: ...here. * btfout.c: Moved to... * btfout.cc: ...here. * builtins.c: Moved to... * builtins.cc: ...here. * caller-save.c: Moved to... * caller-save.cc: ...here. * calls.c: Moved to... * calls.cc: ...here. * ccmp.c: Moved to... * ccmp.cc: ...here. * cfg.c: Moved to... * cfg.cc: ...here. * cfganal.c: Moved to... * cfganal.cc: ...here. * cfgbuild.c: Moved to... * cfgbuild.cc: ...here. * cfgcleanup.c: Moved to... * cfgcleanup.cc: ...here. * cfgexpand.c: Moved to... * cfgexpand.cc: ...here. * cfghooks.c: Moved to... * cfghooks.cc: ...here. * cfgloop.c: Moved to... * cfgloop.cc: ...here. * cfgloopanal.c: Moved to... * cfgloopanal.cc: ...here. * cfgloopmanip.c: Moved to... * cfgloopmanip.cc: ...here. * cfgrtl.c: Moved to... * cfgrtl.cc: ...here. * cgraph.c: Moved to... * cgraph.cc: ...here. * cgraphbuild.c: Moved to... * cgraphbuild.cc: ...here. * cgraphclones.c: Moved to... * cgraphclones.cc: ...here. * cgraphunit.c: Moved to... * cgraphunit.cc: ...here. * collect-utils.c: Moved to... * collect-utils.cc: ...here. * collect2-aix.c: Moved to... * collect2-aix.cc: ...here. * collect2.c: Moved to... * collect2.cc: ...here. * combine-stack-adj.c: Moved to... * combine-stack-adj.cc: ...here. * combine.c: Moved to... * combine.cc: ...here. * common/common-targhooks.c: Moved to... * common/common-targhooks.cc: ...here. * common/config/aarch64/aarch64-common.c: Moved to... * common/config/aarch64/aarch64-common.cc: ...here. * common/config/alpha/alpha-common.c: Moved to... * common/config/alpha/alpha-common.cc: ...here. * common/config/arc/arc-common.c: Moved to... * common/config/arc/arc-common.cc: ...here. * common/config/arm/arm-common.c: Moved to... * common/config/arm/arm-common.cc: ...here. * common/config/avr/avr-common.c: Moved to... * common/config/avr/avr-common.cc: ...here. * common/config/bfin/bfin-common.c: Moved to... * common/config/bfin/bfin-common.cc: ...here. * common/config/bpf/bpf-common.c: Moved to... * common/config/bpf/bpf-common.cc: ...here. * common/config/c6x/c6x-common.c: Moved to... * common/config/c6x/c6x-common.cc: ...here. * common/config/cr16/cr16-common.c: Moved to... * common/config/cr16/cr16-common.cc: ...here. * common/config/cris/cris-common.c: Moved to... * common/config/cris/cris-common.cc: ...here. * common/config/csky/csky-common.c: Moved to... * common/config/csky/csky-common.cc: ...here. * common/config/default-common.c: Moved to... * common/config/default-common.cc: ...here. * common/config/epiphany/epiphany-common.c: Moved to... * common/config/epiphany/epiphany-common.cc: ...here. * common/config/fr30/fr30-common.c: Moved to... * common/config/fr30/fr30-common.cc: ...here. * common/config/frv/frv-common.c: Moved to... * common/config/frv/frv-common.cc: ...here. * common/config/gcn/gcn-common.c: Moved to... * common/config/gcn/gcn-common.cc: ...here. * common/config/h8300/h8300-common.c: Moved to... * common/config/h8300/h8300-common.cc: ...here. * common/config/i386/i386-common.c: Moved to... * common/config/i386/i386-common.cc: ...here. * common/config/ia64/ia64-common.c: Moved to... * common/config/ia64/ia64-common.cc: ...here. * common/config/iq2000/iq2000-common.c: Moved to... * common/config/iq2000/iq2000-common.cc: ...here. * common/config/lm32/lm32-common.c: Moved to... * common/config/lm32/lm32-common.cc: ...here. * common/config/m32r/m32r-common.c: Moved to... * common/config/m32r/m32r-common.cc: ...here. * common/config/m68k/m68k-common.c: Moved to... * common/config/m68k/m68k-common.cc: ...here. * common/config/mcore/mcore-common.c: Moved to... * common/config/mcore/mcore-common.cc: ...here. * common/config/microblaze/microblaze-common.c: Moved to... * common/config/microblaze/microblaze-common.cc: ...here. * common/config/mips/mips-common.c: Moved to... * common/config/mips/mips-common.cc: ...here. * common/config/mmix/mmix-common.c: Moved to... * common/config/mmix/mmix-common.cc: ...here. * common/config/mn10300/mn10300-common.c: Moved to... * common/config/mn10300/mn10300-common.cc: ...here. * common/config/msp430/msp430-common.c: Moved to... * common/config/msp430/msp430-common.cc: ...here. * common/config/nds32/nds32-common.c: Moved to... * common/config/nds32/nds32-common.cc: ...here. * common/config/nios2/nios2-common.c: Moved to... * common/config/nios2/nios2-common.cc: ...here. * common/config/nvptx/nvptx-common.c: Moved to... * common/config/nvptx/nvptx-common.cc: ...here. * common/config/or1k/or1k-common.c: Moved to... * common/config/or1k/or1k-common.cc: ...here. * common/config/pa/pa-common.c: Moved to... * common/config/pa/pa-common.cc: ...here. * common/config/pdp11/pdp11-common.c: Moved to... * common/config/pdp11/pdp11-common.cc: ...here. * common/config/pru/pru-common.c: Moved to... * common/config/pru/pru-common.cc: ...here. * common/config/riscv/riscv-common.c: Moved to... * common/config/riscv/riscv-common.cc: ...here. * common/config/rs6000/rs6000-common.c: Moved to... * common/config/rs6000/rs6000-common.cc: ...here. * common/config/rx/rx-common.c: Moved to... * common/config/rx/rx-common.cc: ...here. * common/config/s390/s390-common.c: Moved to... * common/config/s390/s390-common.cc: ...here. * common/config/sh/sh-common.c: Moved to... * common/config/sh/sh-common.cc: ...here. * common/config/sparc/sparc-common.c: Moved to... * common/config/sparc/sparc-common.cc: ...here. * common/config/tilegx/tilegx-common.c: Moved to... * common/config/tilegx/tilegx-common.cc: ...here. * common/config/tilepro/tilepro-common.c: Moved to... * common/config/tilepro/tilepro-common.cc: ...here. * common/config/v850/v850-common.c: Moved to... * common/config/v850/v850-common.cc: ...here. * common/config/vax/vax-common.c: Moved to... * common/config/vax/vax-common.cc: ...here. * common/config/visium/visium-common.c: Moved to... * common/config/visium/visium-common.cc: ...here. * common/config/xstormy16/xstormy16-common.c: Moved to... * common/config/xstormy16/xstormy16-common.cc: ...here. * common/config/xtensa/xtensa-common.c: Moved to... * common/config/xtensa/xtensa-common.cc: ...here. * compare-elim.c: Moved to... * compare-elim.cc: ...here. * config/aarch64/aarch64-bti-insert.c: Moved to... * config/aarch64/aarch64-bti-insert.cc: ...here. * config/aarch64/aarch64-builtins.c: Moved to... * config/aarch64/aarch64-builtins.cc: ...here. * config/aarch64/aarch64-c.c: Moved to... * config/aarch64/aarch64-c.cc: ...here. * config/aarch64/aarch64-d.c: Moved to... * config/aarch64/aarch64-d.cc: ...here. * config/aarch64/aarch64.c: Moved to... * config/aarch64/aarch64.cc: ...here. * config/aarch64/cortex-a57-fma-steering.c: Moved to... * config/aarch64/cortex-a57-fma-steering.cc: ...here. * config/aarch64/driver-aarch64.c: Moved to... * config/aarch64/driver-aarch64.cc: ...here. * config/aarch64/falkor-tag-collision-avoidance.c: Moved to... * config/aarch64/falkor-tag-collision-avoidance.cc: ...here. * config/aarch64/host-aarch64-darwin.c: Moved to... * config/aarch64/host-aarch64-darwin.cc: ...here. * config/alpha/alpha.c: Moved to... * config/alpha/alpha.cc: ...here. * config/alpha/driver-alpha.c: Moved to... * config/alpha/driver-alpha.cc: ...here. * config/arc/arc-c.c: Moved to... * config/arc/arc-c.cc: ...here. * config/arc/arc.c: Moved to... * config/arc/arc.cc: ...here. * config/arc/driver-arc.c: Moved to... * config/arc/driver-arc.cc: ...here. * config/arm/aarch-common.c: Moved to... * config/arm/aarch-common.cc: ...here. * config/arm/arm-builtins.c: Moved to... * config/arm/arm-builtins.cc: ...here. * config/arm/arm-c.c: Moved to... * config/arm/arm-c.cc: ...here. * config/arm/arm-d.c: Moved to... * config/arm/arm-d.cc: ...here. * config/arm/arm.c: Moved to... * config/arm/arm.cc: ...here. * config/arm/driver-arm.c: Moved to... * config/arm/driver-arm.cc: ...here. * config/avr/avr-c.c: Moved to... * config/avr/avr-c.cc: ...here. * config/avr/avr-devices.c: Moved to... * config/avr/avr-devices.cc: ...here. * config/avr/avr-log.c: Moved to... * config/avr/avr-log.cc: ...here. * config/avr/avr.c: Moved to... * config/avr/avr.cc: ...here. * config/avr/driver-avr.c: Moved to... * config/avr/driver-avr.cc: ...here. * config/avr/gen-avr-mmcu-specs.c: Moved to... * config/avr/gen-avr-mmcu-specs.cc: ...here. * config/avr/gen-avr-mmcu-texi.c: Moved to... * config/avr/gen-avr-mmcu-texi.cc: ...here. * config/bfin/bfin.c: Moved to... * config/bfin/bfin.cc: ...here. * config/bpf/bpf.c: Moved to... * config/bpf/bpf.cc: ...here. * config/bpf/coreout.c: Moved to... * config/bpf/coreout.cc: ...here. * config/c6x/c6x.c: Moved to... * config/c6x/c6x.cc: ...here. * config/cr16/cr16.c: Moved to... * config/cr16/cr16.cc: ...here. * config/cris/cris.c: Moved to... * config/cris/cris.cc: ...here. * config/csky/csky.c: Moved to... * config/csky/csky.cc: ...here. * config/darwin-c.c: Moved to... * config/darwin-c.cc: ...here. * config/darwin-d.c: Moved to... * config/darwin-d.cc: ...here. * config/darwin-driver.c: Moved to... * config/darwin-driver.cc: ...here. * config/darwin-f.c: Moved to... * config/darwin-f.cc: ...here. * config/darwin.c: Moved to... * config/darwin.cc: ...here. * config/default-c.c: Moved to... * config/default-c.cc: ...here. * config/default-d.c: Moved to... * config/default-d.cc: ...here. * config/dragonfly-d.c: Moved to... * config/dragonfly-d.cc: ...here. * config/epiphany/epiphany.c: Moved to... * config/epiphany/epiphany.cc: ...here. * config/epiphany/mode-switch-use.c: Moved to... * config/epiphany/mode-switch-use.cc: ...here. * config/epiphany/resolve-sw-modes.c: Moved to... * config/epiphany/resolve-sw-modes.cc: ...here. * config/fr30/fr30.c: Moved to... * config/fr30/fr30.cc: ...here. * config/freebsd-d.c: Moved to... * config/freebsd-d.cc: ...here. * config/frv/frv.c: Moved to... * config/frv/frv.cc: ...here. * config/ft32/ft32.c: Moved to... * config/ft32/ft32.cc: ...here. * config/gcn/driver-gcn.c: Moved to... * config/gcn/driver-gcn.cc: ...here. * config/gcn/gcn-run.c: Moved to... * config/gcn/gcn-run.cc: ...here. * config/gcn/gcn-tree.c: Moved to... * config/gcn/gcn-tree.cc: ...here. * config/gcn/gcn.c: Moved to... * config/gcn/gcn.cc: ...here. * config/gcn/mkoffload.c: Moved to... * config/gcn/mkoffload.cc: ...here. * config/glibc-c.c: Moved to... * config/glibc-c.cc: ...here. * config/glibc-d.c: Moved to... * config/glibc-d.cc: ...here. * config/h8300/h8300.c: Moved to... * config/h8300/h8300.cc: ...here. * config/host-darwin.c: Moved to... * config/host-darwin.cc: ...here. * config/host-hpux.c: Moved to... * config/host-hpux.cc: ...here. * config/host-linux.c: Moved to... * config/host-linux.cc: ...here. * config/host-netbsd.c: Moved to... * config/host-netbsd.cc: ...here. * config/host-openbsd.c: Moved to... * config/host-openbsd.cc: ...here. * config/host-solaris.c: Moved to... * config/host-solaris.cc: ...here. * config/i386/djgpp.c: Moved to... * config/i386/djgpp.cc: ...here. * config/i386/driver-i386.c: Moved to... * config/i386/driver-i386.cc: ...here. * config/i386/driver-mingw32.c: Moved to... * config/i386/driver-mingw32.cc: ...here. * config/i386/gnu-property.c: Moved to... * config/i386/gnu-property.cc: ...here. * config/i386/host-cygwin.c: Moved to... * config/i386/host-cygwin.cc: ...here. * config/i386/host-i386-darwin.c: Moved to... * config/i386/host-i386-darwin.cc: ...here. * config/i386/host-mingw32.c: Moved to... * config/i386/host-mingw32.cc: ...here. * config/i386/i386-builtins.c: Moved to... * config/i386/i386-builtins.cc: ...here. * config/i386/i386-c.c: Moved to... * config/i386/i386-c.cc: ...here. * config/i386/i386-d.c: Moved to... * config/i386/i386-d.cc: ...here. * config/i386/i386-expand.c: Moved to... * config/i386/i386-expand.cc: ...here. * config/i386/i386-features.c: Moved to... * config/i386/i386-features.cc: ...here. * config/i386/i386-options.c: Moved to... * config/i386/i386-options.cc: ...here. * config/i386/i386.c: Moved to... * config/i386/i386.cc: ...here. * config/i386/intelmic-mkoffload.c: Moved to... * config/i386/intelmic-mkoffload.cc: ...here. * config/i386/msformat-c.c: Moved to... * config/i386/msformat-c.cc: ...here. * config/i386/winnt-cxx.c: Moved to... * config/i386/winnt-cxx.cc: ...here. * config/i386/winnt-d.c: Moved to... * config/i386/winnt-d.cc: ...here. * config/i386/winnt-stubs.c: Moved to... * config/i386/winnt-stubs.cc: ...here. * config/i386/winnt.c: Moved to... * config/i386/winnt.cc: ...here. * config/i386/x86-tune-sched-atom.c: Moved to... * config/i386/x86-tune-sched-atom.cc: ...here. * config/i386/x86-tune-sched-bd.c: Moved to... * config/i386/x86-tune-sched-bd.cc: ...here. * config/i386/x86-tune-sched-core.c: Moved to... * config/i386/x86-tune-sched-core.cc: ...here. * config/i386/x86-tune-sched.c: Moved to... * config/i386/x86-tune-sched.cc: ...here. * config/ia64/ia64-c.c: Moved to... * config/ia64/ia64-c.cc: ...here. * config/ia64/ia64.c: Moved to... * config/ia64/ia64.cc: ...here. * config/iq2000/iq2000.c: Moved to... * config/iq2000/iq2000.cc: ...here. * config/linux.c: Moved to... * config/linux.cc: ...here. * config/lm32/lm32.c: Moved to... * config/lm32/lm32.cc: ...here. * config/m32c/m32c-pragma.c: Moved to... * config/m32c/m32c-pragma.cc: ...here. * config/m32c/m32c.c: Moved to... * config/m32c/m32c.cc: ...here. * config/m32r/m32r.c: Moved to... * config/m32r/m32r.cc: ...here. * config/m68k/m68k.c: Moved to... * config/m68k/m68k.cc: ...here. * config/mcore/mcore.c: Moved to... * config/mcore/mcore.cc: ...here. * config/microblaze/microblaze-c.c: Moved to... * config/microblaze/microblaze-c.cc: ...here. * config/microblaze/microblaze.c: Moved to... * config/microblaze/microblaze.cc: ...here. * config/mips/driver-native.c: Moved to... * config/mips/driver-native.cc: ...here. * config/mips/frame-header-opt.c: Moved to... * config/mips/frame-header-opt.cc: ...here. * config/mips/mips-d.c: Moved to... * config/mips/mips-d.cc: ...here. * config/mips/mips.c: Moved to... * config/mips/mips.cc: ...here. * config/mmix/mmix.c: Moved to... * config/mmix/mmix.cc: ...here. * config/mn10300/mn10300.c: Moved to... * config/mn10300/mn10300.cc: ...here. * config/moxie/moxie.c: Moved to... * config/moxie/moxie.cc: ...here. * config/msp430/driver-msp430.c: Moved to... * config/msp430/driver-msp430.cc: ...here. * config/msp430/msp430-c.c: Moved to... * config/msp430/msp430-c.cc: ...here. * config/msp430/msp430-devices.c: Moved to... * config/msp430/msp430-devices.cc: ...here. * config/msp430/msp430.c: Moved to... * config/msp430/msp430.cc: ...here. * config/nds32/nds32-cost.c: Moved to... * config/nds32/nds32-cost.cc: ...here. * config/nds32/nds32-fp-as-gp.c: Moved to... * config/nds32/nds32-fp-as-gp.cc: ...here. * config/nds32/nds32-intrinsic.c: Moved to... * config/nds32/nds32-intrinsic.cc: ...here. * config/nds32/nds32-isr.c: Moved to... * config/nds32/nds32-isr.cc: ...here. * config/nds32/nds32-md-auxiliary.c: Moved to... * config/nds32/nds32-md-auxiliary.cc: ...here. * config/nds32/nds32-memory-manipulation.c: Moved to... * config/nds32/nds32-memory-manipulation.cc: ...here. * config/nds32/nds32-pipelines-auxiliary.c: Moved to... * config/nds32/nds32-pipelines-auxiliary.cc: ...here. * config/nds32/nds32-predicates.c: Moved to... * config/nds32/nds32-predicates.cc: ...here. * config/nds32/nds32-relax-opt.c: Moved to... * config/nds32/nds32-relax-opt.cc: ...here. * config/nds32/nds32-utils.c: Moved to... * config/nds32/nds32-utils.cc: ...here. * config/nds32/nds32.c: Moved to... * config/nds32/nds32.cc: ...here. * config/netbsd-d.c: Moved to... * config/netbsd-d.cc: ...here. * config/netbsd.c: Moved to... * config/netbsd.cc: ...here. * config/nios2/nios2.c: Moved to... * config/nios2/nios2.cc: ...here. * config/nvptx/mkoffload.c: Moved to... * config/nvptx/mkoffload.cc: ...here. * config/nvptx/nvptx-c.c: Moved to... * config/nvptx/nvptx-c.cc: ...here. * config/nvptx/nvptx.c: Moved to... * config/nvptx/nvptx.cc: ...here. * config/openbsd-d.c: Moved to... * config/openbsd-d.cc: ...here. * config/or1k/or1k.c: Moved to... * config/or1k/or1k.cc: ...here. * config/pa/pa-d.c: Moved to... * config/pa/pa-d.cc: ...here. * config/pa/pa.c: Moved to... * config/pa/pa.cc: ...here. * config/pdp11/pdp11.c: Moved to... * config/pdp11/pdp11.cc: ...here. * config/pru/pru-passes.c: Moved to... * config/pru/pru-passes.cc: ...here. * config/pru/pru-pragma.c: Moved to... * config/pru/pru-pragma.cc: ...here. * config/pru/pru.c: Moved to... * config/pru/pru.cc: ...here. * config/riscv/riscv-builtins.c: Moved to... * config/riscv/riscv-builtins.cc: ...here. * config/riscv/riscv-c.c: Moved to... * config/riscv/riscv-c.cc: ...here. * config/riscv/riscv-d.c: Moved to... * config/riscv/riscv-d.cc: ...here. * config/riscv/riscv-shorten-memrefs.c: Moved to... * config/riscv/riscv-shorten-memrefs.cc: ...here. * config/riscv/riscv-sr.c: Moved to... * config/riscv/riscv-sr.cc: ...here. * config/riscv/riscv.c: Moved to... * config/riscv/riscv.cc: ...here. * config/rl78/rl78-c.c: Moved to... * config/rl78/rl78-c.cc: ...here. * config/rl78/rl78.c: Moved to... * config/rl78/rl78.cc: ...here. * config/rs6000/driver-rs6000.c: Moved to... * config/rs6000/driver-rs6000.cc: ...here. * config/rs6000/host-darwin.c: Moved to... * config/rs6000/host-darwin.cc: ...here. * config/rs6000/host-ppc64-darwin.c: Moved to... * config/rs6000/host-ppc64-darwin.cc: ...here. * config/rs6000/rbtree.c: Moved to... * config/rs6000/rbtree.cc: ...here. * config/rs6000/rs6000-c.c: Moved to... * config/rs6000/rs6000-c.cc: ...here. * config/rs6000/rs6000-call.c: Moved to... * config/rs6000/rs6000-call.cc: ...here. * config/rs6000/rs6000-d.c: Moved to... * config/rs6000/rs6000-d.cc: ...here. * config/rs6000/rs6000-gen-builtins.c: Moved to... * config/rs6000/rs6000-gen-builtins.cc: ...here. * config/rs6000/rs6000-linux.c: Moved to... * config/rs6000/rs6000-linux.cc: ...here. * config/rs6000/rs6000-logue.c: Moved to... * config/rs6000/rs6000-logue.cc: ...here. * config/rs6000/rs6000-p8swap.c: Moved to... * config/rs6000/rs6000-p8swap.cc: ...here. * config/rs6000/rs6000-pcrel-opt.c: Moved to... * config/rs6000/rs6000-pcrel-opt.cc: ...here. * config/rs6000/rs6000-string.c: Moved to... * config/rs6000/rs6000-string.cc: ...here. * config/rs6000/rs6000.c: Moved to... * config/rs6000/rs6000.cc: ...here. * config/rx/rx.c: Moved to... * config/rx/rx.cc: ...here. * config/s390/driver-native.c: Moved to... * config/s390/driver-native.cc: ...here. * config/s390/s390-c.c: Moved to... * config/s390/s390-c.cc: ...here. * config/s390/s390-d.c: Moved to... * config/s390/s390-d.cc: ...here. * config/s390/s390.c: Moved to... * config/s390/s390.cc: ...here. * config/sh/divtab-sh4-300.c: Moved to... * config/sh/divtab-sh4-300.cc: ...here. * config/sh/divtab-sh4.c: Moved to... * config/sh/divtab-sh4.cc: ...here. * config/sh/divtab.c: Moved to... * config/sh/divtab.cc: ...here. * config/sh/sh-c.c: Moved to... * config/sh/sh-c.cc: ...here. * config/sh/sh.c: Moved to... * config/sh/sh.cc: ...here. * config/sol2-c.c: Moved to... * config/sol2-c.cc: ...here. * config/sol2-cxx.c: Moved to... * config/sol2-cxx.cc: ...here. * config/sol2-d.c: Moved to... * config/sol2-d.cc: ...here. * config/sol2-stubs.c: Moved to... * config/sol2-stubs.cc: ...here. * config/sol2.c: Moved to... * config/sol2.cc: ...here. * config/sparc/driver-sparc.c: Moved to... * config/sparc/driver-sparc.cc: ...here. * config/sparc/sparc-c.c: Moved to... * config/sparc/sparc-c.cc: ...here. * config/sparc/sparc-d.c: Moved to... * config/sparc/sparc-d.cc: ...here. * config/sparc/sparc.c: Moved to... * config/sparc/sparc.cc: ...here. * config/stormy16/stormy16.c: Moved to... * config/stormy16/stormy16.cc: ...here. * config/tilegx/mul-tables.c: Moved to... * config/tilegx/mul-tables.cc: ...here. * config/tilegx/tilegx-c.c: Moved to... * config/tilegx/tilegx-c.cc: ...here. * config/tilegx/tilegx.c: Moved to... * config/tilegx/tilegx.cc: ...here. * config/tilepro/mul-tables.c: Moved to... * config/tilepro/mul-tables.cc: ...here. * config/tilepro/tilepro-c.c: Moved to... * config/tilepro/tilepro-c.cc: ...here. * config/tilepro/tilepro.c: Moved to... * config/tilepro/tilepro.cc: ...here. * config/v850/v850-c.c: Moved to... * config/v850/v850-c.cc: ...here. * config/v850/v850.c: Moved to... * config/v850/v850.cc: ...here. * config/vax/vax.c: Moved to... * config/vax/vax.cc: ...here. * config/visium/visium.c: Moved to... * config/visium/visium.cc: ...here. * config/vms/vms-c.c: Moved to... * config/vms/vms-c.cc: ...here. * config/vms/vms-f.c: Moved to... * config/vms/vms-f.cc: ...here. * config/vms/vms.c: Moved to... * config/vms/vms.cc: ...here. * config/vxworks-c.c: Moved to... * config/vxworks-c.cc: ...here. * config/vxworks.c: Moved to... * config/vxworks.cc: ...here. * config/winnt-c.c: Moved to... * config/winnt-c.cc: ...here. * config/xtensa/xtensa.c: Moved to... * config/xtensa/xtensa.cc: ...here. * context.c: Moved to... * context.cc: ...here. * convert.c: Moved to... * convert.cc: ...here. * coverage.c: Moved to... * coverage.cc: ...here. * cppbuiltin.c: Moved to... * cppbuiltin.cc: ...here. * cppdefault.c: Moved to... * cppdefault.cc: ...here. * cprop.c: Moved to... * cprop.cc: ...here. * cse.c: Moved to... * cse.cc: ...here. * cselib.c: Moved to... * cselib.cc: ...here. * ctfc.c: Moved to... * ctfc.cc: ...here. * ctfout.c: Moved to... * ctfout.cc: ...here. * data-streamer-in.c: Moved to... * data-streamer-in.cc: ...here. * data-streamer-out.c: Moved to... * data-streamer-out.cc: ...here. * data-streamer.c: Moved to... * data-streamer.cc: ...here. * dbgcnt.c: Moved to... * dbgcnt.cc: ...here. * dbxout.c: Moved to... * dbxout.cc: ...here. * dce.c: Moved to... * dce.cc: ...here. * ddg.c: Moved to... * ddg.cc: ...here. * debug.c: Moved to... * debug.cc: ...here. * df-core.c: Moved to... * df-core.cc: ...here. * df-problems.c: Moved to... * df-problems.cc: ...here. * df-scan.c: Moved to... * df-scan.cc: ...here. * dfp.c: Moved to... * dfp.cc: ...here. * diagnostic-color.c: Moved to... * diagnostic-color.cc: ...here. * diagnostic-show-locus.c: Moved to... * diagnostic-show-locus.cc: ...here. * diagnostic-spec.c: Moved to... * diagnostic-spec.cc: ...here. * diagnostic.c: Moved to... * diagnostic.cc: ...here. * dojump.c: Moved to... * dojump.cc: ...here. * dominance.c: Moved to... * dominance.cc: ...here. * domwalk.c: Moved to... * domwalk.cc: ...here. * double-int.c: Moved to... * double-int.cc: ...here. * dse.c: Moved to... * dse.cc: ...here. * dumpfile.c: Moved to... * dumpfile.cc: ...here. * dwarf2asm.c: Moved to... * dwarf2asm.cc: ...here. * dwarf2cfi.c: Moved to... * dwarf2cfi.cc: ...here. * dwarf2ctf.c: Moved to... * dwarf2ctf.cc: ...here. * dwarf2out.c: Moved to... * dwarf2out.cc: ...here. * early-remat.c: Moved to... * early-remat.cc: ...here. * edit-context.c: Moved to... * edit-context.cc: ...here. * emit-rtl.c: Moved to... * emit-rtl.cc: ...here. * errors.c: Moved to... * errors.cc: ...here. * et-forest.c: Moved to... * et-forest.cc: ...here. * except.c: Moved to... * except.cc: ...here. * explow.c: Moved to... * explow.cc: ...here. * expmed.c: Moved to... * expmed.cc: ...here. * expr.c: Moved to... * expr.cc: ...here. * fibonacci_heap.c: Moved to... * fibonacci_heap.cc: ...here. * file-find.c: Moved to... * file-find.cc: ...here. * file-prefix-map.c: Moved to... * file-prefix-map.cc: ...here. * final.c: Moved to... * final.cc: ...here. * fixed-value.c: Moved to... * fixed-value.cc: ...here. * fold-const-call.c: Moved to... * fold-const-call.cc: ...here. * fold-const.c: Moved to... * fold-const.cc: ...here. * fp-test.c: Moved to... * fp-test.cc: ...here. * function-tests.c: Moved to... * function-tests.cc: ...here. * function.c: Moved to... * function.cc: ...here. * fwprop.c: Moved to... * fwprop.cc: ...here. * gcc-ar.c: Moved to... * gcc-ar.cc: ...here. * gcc-main.c: Moved to... * gcc-main.cc: ...here. * gcc-rich-location.c: Moved to... * gcc-rich-location.cc: ...here. * gcc.c: Moved to... * gcc.cc: ...here. * gcov-dump.c: Moved to... * gcov-dump.cc: ...here. * gcov-io.c: Moved to... * gcov-io.cc: ...here. * gcov-tool.c: Moved to... * gcov-tool.cc: ...here. * gcov.c: Moved to... * gcov.cc: ...here. * gcse-common.c: Moved to... * gcse-common.cc: ...here. * gcse.c: Moved to... * gcse.cc: ...here. * genattr-common.c: Moved to... * genattr-common.cc: ...here. * genattr.c: Moved to... * genattr.cc: ...here. * genattrtab.c: Moved to... * genattrtab.cc: ...here. * genautomata.c: Moved to... * genautomata.cc: ...here. * gencfn-macros.c: Moved to... * gencfn-macros.cc: ...here. * gencheck.c: Moved to... * gencheck.cc: ...here. * genchecksum.c: Moved to... * genchecksum.cc: ...here. * gencodes.c: Moved to... * gencodes.cc: ...here. * genconditions.c: Moved to... * genconditions.cc: ...here. * genconfig.c: Moved to... * genconfig.cc: ...here. * genconstants.c: Moved to... * genconstants.cc: ...here. * genemit.c: Moved to... * genemit.cc: ...here. * genenums.c: Moved to... * genenums.cc: ...here. * generic-match-head.c: Moved to... * generic-match-head.cc: ...here. * genextract.c: Moved to... * genextract.cc: ...here. * genflags.c: Moved to... * genflags.cc: ...here. * gengenrtl.c: Moved to... * gengenrtl.cc: ...here. * gengtype-parse.c: Moved to... * gengtype-parse.cc: ...here. * gengtype-state.c: Moved to... * gengtype-state.cc: ...here. * gengtype.c: Moved to... * gengtype.cc: ...here. * genhooks.c: Moved to... * genhooks.cc: ...here. * genmatch.c: Moved to... * genmatch.cc: ...here. * genmddeps.c: Moved to... * genmddeps.cc: ...here. * genmddump.c: Moved to... * genmddump.cc: ...here. * genmodes.c: Moved to... * genmodes.cc: ...here. * genopinit.c: Moved to... * genopinit.cc: ...here. * genoutput.c: Moved to... * genoutput.cc: ...here. * genpeep.c: Moved to... * genpeep.cc: ...here. * genpreds.c: Moved to... * genpreds.cc: ...here. * genrecog.c: Moved to... * genrecog.cc: ...here. * gensupport.c: Moved to... * gensupport.cc: ...here. * gentarget-def.c: Moved to... * gentarget-def.cc: ...here. * genversion.c: Moved to... * genversion.cc: ...here. * ggc-common.c: Moved to... * ggc-common.cc: ...here. * ggc-none.c: Moved to... * ggc-none.cc: ...here. * ggc-page.c: Moved to... * ggc-page.cc: ...here. * ggc-tests.c: Moved to... * ggc-tests.cc: ...here. * gimple-builder.c: Moved to... * gimple-builder.cc: ...here. * gimple-expr.c: Moved to... * gimple-expr.cc: ...here. * gimple-fold.c: Moved to... * gimple-fold.cc: ...here. * gimple-iterator.c: Moved to... * gimple-iterator.cc: ...here. * gimple-laddress.c: Moved to... * gimple-laddress.cc: ...here. * gimple-loop-jam.c: Moved to... * gimple-loop-jam.cc: ...here. * gimple-low.c: Moved to... * gimple-low.cc: ...here. * gimple-match-head.c: Moved to... * gimple-match-head.cc: ...here. * gimple-pretty-print.c: Moved to... * gimple-pretty-print.cc: ...here. * gimple-ssa-backprop.c: Moved to... * gimple-ssa-backprop.cc: ...here. * gimple-ssa-evrp-analyze.c: Moved to... * gimple-ssa-evrp-analyze.cc: ...here. * gimple-ssa-evrp.c: Moved to... * gimple-ssa-evrp.cc: ...here. * gimple-ssa-isolate-paths.c: Moved to... * gimple-ssa-isolate-paths.cc: ...here. * gimple-ssa-nonnull-compare.c: Moved to... * gimple-ssa-nonnull-compare.cc: ...here. * gimple-ssa-split-paths.c: Moved to... * gimple-ssa-split-paths.cc: ...here. * gimple-ssa-sprintf.c: Moved to... * gimple-ssa-sprintf.cc: ...here. * gimple-ssa-store-merging.c: Moved to... * gimple-ssa-store-merging.cc: ...here. * gimple-ssa-strength-reduction.c: Moved to... * gimple-ssa-strength-reduction.cc: ...here. * gimple-ssa-warn-alloca.c: Moved to... * gimple-ssa-warn-alloca.cc: ...here. * gimple-ssa-warn-restrict.c: Moved to... * gimple-ssa-warn-restrict.cc: ...here. * gimple-streamer-in.c: Moved to... * gimple-streamer-in.cc: ...here. * gimple-streamer-out.c: Moved to... * gimple-streamer-out.cc: ...here. * gimple-walk.c: Moved to... * gimple-walk.cc: ...here. * gimple-warn-recursion.c: Moved to... * gimple-warn-recursion.cc: ...here. * gimple.c: Moved to... * gimple.cc: ...here. * gimplify-me.c: Moved to... * gimplify-me.cc: ...here. * gimplify.c: Moved to... * gimplify.cc: ...here. * godump.c: Moved to... * godump.cc: ...here. * graph.c: Moved to... * graph.cc: ...here. * graphds.c: Moved to... * graphds.cc: ...here. * graphite-dependences.c: Moved to... * graphite-dependences.cc: ...here. * graphite-isl-ast-to-gimple.c: Moved to... * graphite-isl-ast-to-gimple.cc: ...here. * graphite-optimize-isl.c: Moved to... * graphite-optimize-isl.cc: ...here. * graphite-poly.c: Moved to... * graphite-poly.cc: ...here. * graphite-scop-detection.c: Moved to... * graphite-scop-detection.cc: ...here. * graphite-sese-to-poly.c: Moved to... * graphite-sese-to-poly.cc: ...here. * graphite.c: Moved to... * graphite.cc: ...here. * haifa-sched.c: Moved to... * haifa-sched.cc: ...here. * hash-map-tests.c: Moved to... * hash-map-tests.cc: ...here. * hash-set-tests.c: Moved to... * hash-set-tests.cc: ...here. * hash-table.c: Moved to... * hash-table.cc: ...here. * hooks.c: Moved to... * hooks.cc: ...here. * host-default.c: Moved to... * host-default.cc: ...here. * hw-doloop.c: Moved to... * hw-doloop.cc: ...here. * hwint.c: Moved to... * hwint.cc: ...here. * ifcvt.c: Moved to... * ifcvt.cc: ...here. * inchash.c: Moved to... * inchash.cc: ...here. * incpath.c: Moved to... * incpath.cc: ...here. * init-regs.c: Moved to... * init-regs.cc: ...here. * input.c: Moved to... * input.cc: ...here. * internal-fn.c: Moved to... * internal-fn.cc: ...here. * intl.c: Moved to... * intl.cc: ...here. * ipa-comdats.c: Moved to... * ipa-comdats.cc: ...here. * ipa-cp.c: Moved to... * ipa-cp.cc: ...here. * ipa-devirt.c: Moved to... * ipa-devirt.cc: ...here. * ipa-fnsummary.c: Moved to... * ipa-fnsummary.cc: ...here. * ipa-icf-gimple.c: Moved to... * ipa-icf-gimple.cc: ...here. * ipa-icf.c: Moved to... * ipa-icf.cc: ...here. * ipa-inline-analysis.c: Moved to... * ipa-inline-analysis.cc: ...here. * ipa-inline-transform.c: Moved to... * ipa-inline-transform.cc: ...here. * ipa-inline.c: Moved to... * ipa-inline.cc: ...here. * ipa-modref-tree.c: Moved to... * ipa-modref-tree.cc: ...here. * ipa-modref.c: Moved to... * ipa-modref.cc: ...here. * ipa-param-manipulation.c: Moved to... * ipa-param-manipulation.cc: ...here. * ipa-polymorphic-call.c: Moved to... * ipa-polymorphic-call.cc: ...here. * ipa-predicate.c: Moved to... * ipa-predicate.cc: ...here. * ipa-profile.c: Moved to... * ipa-profile.cc: ...here. * ipa-prop.c: Moved to... * ipa-prop.cc: ...here. * ipa-pure-const.c: Moved to... * ipa-pure-const.cc: ...here. * ipa-ref.c: Moved to... * ipa-ref.cc: ...here. * ipa-reference.c: Moved to... * ipa-reference.cc: ...here. * ipa-split.c: Moved to... * ipa-split.cc: ...here. * ipa-sra.c: Moved to... * ipa-sra.cc: ...here. * ipa-utils.c: Moved to... * ipa-utils.cc: ...here. * ipa-visibility.c: Moved to... * ipa-visibility.cc: ...here. * ipa.c: Moved to... * ipa.cc: ...here. * ira-build.c: Moved to... * ira-build.cc: ...here. * ira-color.c: Moved to... * ira-color.cc: ...here. * ira-conflicts.c: Moved to... * ira-conflicts.cc: ...here. * ira-costs.c: Moved to... * ira-costs.cc: ...here. * ira-emit.c: Moved to... * ira-emit.cc: ...here. * ira-lives.c: Moved to... * ira-lives.cc: ...here. * ira.c: Moved to... * ira.cc: ...here. * jump.c: Moved to... * jump.cc: ...here. * langhooks.c: Moved to... * langhooks.cc: ...here. * lcm.c: Moved to... * lcm.cc: ...here. * lists.c: Moved to... * lists.cc: ...here. * loop-doloop.c: Moved to... * loop-doloop.cc: ...here. * loop-init.c: Moved to... * loop-init.cc: ...here. * loop-invariant.c: Moved to... * loop-invariant.cc: ...here. * loop-iv.c: Moved to... * loop-iv.cc: ...here. * loop-unroll.c: Moved to... * loop-unroll.cc: ...here. * lower-subreg.c: Moved to... * lower-subreg.cc: ...here. * lra-assigns.c: Moved to... * lra-assigns.cc: ...here. * lra-coalesce.c: Moved to... * lra-coalesce.cc: ...here. * lra-constraints.c: Moved to... * lra-constraints.cc: ...here. * lra-eliminations.c: Moved to... * lra-eliminations.cc: ...here. * lra-lives.c: Moved to... * lra-lives.cc: ...here. * lra-remat.c: Moved to... * lra-remat.cc: ...here. * lra-spills.c: Moved to... * lra-spills.cc: ...here. * lra.c: Moved to... * lra.cc: ...here. * lto-cgraph.c: Moved to... * lto-cgraph.cc: ...here. * lto-compress.c: Moved to... * lto-compress.cc: ...here. * lto-opts.c: Moved to... * lto-opts.cc: ...here. * lto-section-in.c: Moved to... * lto-section-in.cc: ...here. * lto-section-out.c: Moved to... * lto-section-out.cc: ...here. * lto-streamer-in.c: Moved to... * lto-streamer-in.cc: ...here. * lto-streamer-out.c: Moved to... * lto-streamer-out.cc: ...here. * lto-streamer.c: Moved to... * lto-streamer.cc: ...here. * lto-wrapper.c: Moved to... * lto-wrapper.cc: ...here. * main.c: Moved to... * main.cc: ...here. * mcf.c: Moved to... * mcf.cc: ...here. * mode-switching.c: Moved to... * mode-switching.cc: ...here. * modulo-sched.c: Moved to... * modulo-sched.cc: ...here. * multiple_target.c: Moved to... * multiple_target.cc: ...here. * omp-expand.c: Moved to... * omp-expand.cc: ...here. * omp-general.c: Moved to... * omp-general.cc: ...here. * omp-low.c: Moved to... * omp-low.cc: ...here. * omp-offload.c: Moved to... * omp-offload.cc: ...here. * omp-simd-clone.c: Moved to... * omp-simd-clone.cc: ...here. * opt-suggestions.c: Moved to... * opt-suggestions.cc: ...here. * optabs-libfuncs.c: Moved to... * optabs-libfuncs.cc: ...here. * optabs-query.c: Moved to... * optabs-query.cc: ...here. * optabs-tree.c: Moved to... * optabs-tree.cc: ...here. * optabs.c: Moved to... * optabs.cc: ...here. * opts-common.c: Moved to... * opts-common.cc: ...here. * opts-global.c: Moved to... * opts-global.cc: ...here. * opts.c: Moved to... * opts.cc: ...here. * passes.c: Moved to... * passes.cc: ...here. * plugin.c: Moved to... * plugin.cc: ...here. * postreload-gcse.c: Moved to... * postreload-gcse.cc: ...here. * postreload.c: Moved to... * postreload.cc: ...here. * predict.c: Moved to... * predict.cc: ...here. * prefix.c: Moved to... * prefix.cc: ...here. * pretty-print.c: Moved to... * pretty-print.cc: ...here. * print-rtl-function.c: Moved to... * print-rtl-function.cc: ...here. * print-rtl.c: Moved to... * print-rtl.cc: ...here. * print-tree.c: Moved to... * print-tree.cc: ...here. * profile-count.c: Moved to... * profile-count.cc: ...here. * profile.c: Moved to... * profile.cc: ...here. * read-md.c: Moved to... * read-md.cc: ...here. * read-rtl-function.c: Moved to... * read-rtl-function.cc: ...here. * read-rtl.c: Moved to... * read-rtl.cc: ...here. * real.c: Moved to... * real.cc: ...here. * realmpfr.c: Moved to... * realmpfr.cc: ...here. * recog.c: Moved to... * recog.cc: ...here. * ree.c: Moved to... * ree.cc: ...here. * reg-stack.c: Moved to... * reg-stack.cc: ...here. * regcprop.c: Moved to... * regcprop.cc: ...here. * reginfo.c: Moved to... * reginfo.cc: ...here. * regrename.c: Moved to... * regrename.cc: ...here. * regstat.c: Moved to... * regstat.cc: ...here. * reload.c: Moved to... * reload.cc: ...here. * reload1.c: Moved to... * reload1.cc: ...here. * reorg.c: Moved to... * reorg.cc: ...here. * resource.c: Moved to... * resource.cc: ...here. * rtl-error.c: Moved to... * rtl-error.cc: ...here. * rtl-tests.c: Moved to... * rtl-tests.cc: ...here. * rtl.c: Moved to... * rtl.cc: ...here. * rtlanal.c: Moved to... * rtlanal.cc: ...here. * rtlhash.c: Moved to... * rtlhash.cc: ...here. * rtlhooks.c: Moved to... * rtlhooks.cc: ...here. * rtx-vector-builder.c: Moved to... * rtx-vector-builder.cc: ...here. * run-rtl-passes.c: Moved to... * run-rtl-passes.cc: ...here. * sancov.c: Moved to... * sancov.cc: ...here. * sanopt.c: Moved to... * sanopt.cc: ...here. * sbitmap.c: Moved to... * sbitmap.cc: ...here. * sched-deps.c: Moved to... * sched-deps.cc: ...here. * sched-ebb.c: Moved to... * sched-ebb.cc: ...here. * sched-rgn.c: Moved to... * sched-rgn.cc: ...here. * sel-sched-dump.c: Moved to... * sel-sched-dump.cc: ...here. * sel-sched-ir.c: Moved to... * sel-sched-ir.cc: ...here. * sel-sched.c: Moved to... * sel-sched.cc: ...here. * selftest-diagnostic.c: Moved to... * selftest-diagnostic.cc: ...here. * selftest-rtl.c: Moved to... * selftest-rtl.cc: ...here. * selftest-run-tests.c: Moved to... * selftest-run-tests.cc: ...here. * selftest.c: Moved to... * selftest.cc: ...here. * sese.c: Moved to... * sese.cc: ...here. * shrink-wrap.c: Moved to... * shrink-wrap.cc: ...here. * simplify-rtx.c: Moved to... * simplify-rtx.cc: ...here. * sparseset.c: Moved to... * sparseset.cc: ...here. * spellcheck-tree.c: Moved to... * spellcheck-tree.cc: ...here. * spellcheck.c: Moved to... * spellcheck.cc: ...here. * sreal.c: Moved to... * sreal.cc: ...here. * stack-ptr-mod.c: Moved to... * stack-ptr-mod.cc: ...here. * statistics.c: Moved to... * statistics.cc: ...here. * stmt.c: Moved to... * stmt.cc: ...here. * stor-layout.c: Moved to... * stor-layout.cc: ...here. * store-motion.c: Moved to... * store-motion.cc: ...here. * streamer-hooks.c: Moved to... * streamer-hooks.cc: ...here. * stringpool.c: Moved to... * stringpool.cc: ...here. * substring-locations.c: Moved to... * substring-locations.cc: ...here. * symtab.c: Moved to... * symtab.cc: ...here. * target-globals.c: Moved to... * target-globals.cc: ...here. * targhooks.c: Moved to... * targhooks.cc: ...here. * timevar.c: Moved to... * timevar.cc: ...here. * toplev.c: Moved to... * toplev.cc: ...here. * tracer.c: Moved to... * tracer.cc: ...here. * trans-mem.c: Moved to... * trans-mem.cc: ...here. * tree-affine.c: Moved to... * tree-affine.cc: ...here. * tree-call-cdce.c: Moved to... * tree-call-cdce.cc: ...here. * tree-cfg.c: Moved to... * tree-cfg.cc: ...here. * tree-cfgcleanup.c: Moved to... * tree-cfgcleanup.cc: ...here. * tree-chrec.c: Moved to... * tree-chrec.cc: ...here. * tree-complex.c: Moved to... * tree-complex.cc: ...here. * tree-data-ref.c: Moved to... * tree-data-ref.cc: ...here. * tree-dfa.c: Moved to... * tree-dfa.cc: ...here. * tree-diagnostic.c: Moved to... * tree-diagnostic.cc: ...here. * tree-dump.c: Moved to... * tree-dump.cc: ...here. * tree-eh.c: Moved to... * tree-eh.cc: ...here. * tree-emutls.c: Moved to... * tree-emutls.cc: ...here. * tree-if-conv.c: Moved to... * tree-if-conv.cc: ...here. * tree-inline.c: Moved to... * tree-inline.cc: ...here. * tree-into-ssa.c: Moved to... * tree-into-ssa.cc: ...here. * tree-iterator.c: Moved to... * tree-iterator.cc: ...here. * tree-loop-distribution.c: Moved to... * tree-loop-distribution.cc: ...here. * tree-nested.c: Moved to... * tree-nested.cc: ...here. * tree-nrv.c: Moved to... * tree-nrv.cc: ...here. * tree-object-size.c: Moved to... * tree-object-size.cc: ...here. * tree-outof-ssa.c: Moved to... * tree-outof-ssa.cc: ...here. * tree-parloops.c: Moved to... * tree-parloops.cc: ...here. * tree-phinodes.c: Moved to... * tree-phinodes.cc: ...here. * tree-predcom.c: Moved to... * tree-predcom.cc: ...here. * tree-pretty-print.c: Moved to... * tree-pretty-print.cc: ...here. * tree-profile.c: Moved to... * tree-profile.cc: ...here. * tree-scalar-evolution.c: Moved to... * tree-scalar-evolution.cc: ...here. * tree-sra.c: Moved to... * tree-sra.cc: ...here. * tree-ssa-address.c: Moved to... * tree-ssa-address.cc: ...here. * tree-ssa-alias.c: Moved to... * tree-ssa-alias.cc: ...here. * tree-ssa-ccp.c: Moved to... * tree-ssa-ccp.cc: ...here. * tree-ssa-coalesce.c: Moved to... * tree-ssa-coalesce.cc: ...here. * tree-ssa-copy.c: Moved to... * tree-ssa-copy.cc: ...here. * tree-ssa-dce.c: Moved to... * tree-ssa-dce.cc: ...here. * tree-ssa-dom.c: Moved to... * tree-ssa-dom.cc: ...here. * tree-ssa-dse.c: Moved to... * tree-ssa-dse.cc: ...here. * tree-ssa-forwprop.c: Moved to... * tree-ssa-forwprop.cc: ...here. * tree-ssa-ifcombine.c: Moved to... * tree-ssa-ifcombine.cc: ...here. * tree-ssa-live.c: Moved to... * tree-ssa-live.cc: ...here. * tree-ssa-loop-ch.c: Moved to... * tree-ssa-loop-ch.cc: ...here. * tree-ssa-loop-im.c: Moved to... * tree-ssa-loop-im.cc: ...here. * tree-ssa-loop-ivcanon.c: Moved to... * tree-ssa-loop-ivcanon.cc: ...here. * tree-ssa-loop-ivopts.c: Moved to... * tree-ssa-loop-ivopts.cc: ...here. * tree-ssa-loop-manip.c: Moved to... * tree-ssa-loop-manip.cc: ...here. * tree-ssa-loop-niter.c: Moved to... * tree-ssa-loop-niter.cc: ...here. * tree-ssa-loop-prefetch.c: Moved to... * tree-ssa-loop-prefetch.cc: ...here. * tree-ssa-loop-split.c: Moved to... * tree-ssa-loop-split.cc: ...here. * tree-ssa-loop-unswitch.c: Moved to... * tree-ssa-loop-unswitch.cc: ...here. * tree-ssa-loop.c: Moved to... * tree-ssa-loop.cc: ...here. * tree-ssa-math-opts.c: Moved to... * tree-ssa-math-opts.cc: ...here. * tree-ssa-operands.c: Moved to... * tree-ssa-operands.cc: ...here. * tree-ssa-phiopt.c: Moved to... * tree-ssa-phiopt.cc: ...here. * tree-ssa-phiprop.c: Moved to... * tree-ssa-phiprop.cc: ...here. * tree-ssa-pre.c: Moved to... * tree-ssa-pre.cc: ...here. * tree-ssa-propagate.c: Moved to... * tree-ssa-propagate.cc: ...here. * tree-ssa-reassoc.c: Moved to... * tree-ssa-reassoc.cc: ...here. * tree-ssa-sccvn.c: Moved to... * tree-ssa-sccvn.cc: ...here. * tree-ssa-scopedtables.c: Moved to... * tree-ssa-scopedtables.cc: ...here. * tree-ssa-sink.c: Moved to... * tree-ssa-sink.cc: ...here. * tree-ssa-strlen.c: Moved to... * tree-ssa-strlen.cc: ...here. * tree-ssa-structalias.c: Moved to... * tree-ssa-structalias.cc: ...here. * tree-ssa-tail-merge.c: Moved to... * tree-ssa-tail-merge.cc: ...here. * tree-ssa-ter.c: Moved to... * tree-ssa-ter.cc: ...here. * tree-ssa-threadbackward.c: Moved to... * tree-ssa-threadbackward.cc: ...here. * tree-ssa-threadedge.c: Moved to... * tree-ssa-threadedge.cc: ...here. * tree-ssa-threadupdate.c: Moved to... * tree-ssa-threadupdate.cc: ...here. * tree-ssa-uncprop.c: Moved to... * tree-ssa-uncprop.cc: ...here. * tree-ssa-uninit.c: Moved to... * tree-ssa-uninit.cc: ...here. * tree-ssa.c: Moved to... * tree-ssa.cc: ...here. * tree-ssanames.c: Moved to... * tree-ssanames.cc: ...here. * tree-stdarg.c: Moved to... * tree-stdarg.cc: ...here. * tree-streamer-in.c: Moved to... * tree-streamer-in.cc: ...here. * tree-streamer-out.c: Moved to... * tree-streamer-out.cc: ...here. * tree-streamer.c: Moved to... * tree-streamer.cc: ...here. * tree-switch-conversion.c: Moved to... * tree-switch-conversion.cc: ...here. * tree-tailcall.c: Moved to... * tree-tailcall.cc: ...here. * tree-vect-data-refs.c: Moved to... * tree-vect-data-refs.cc: ...here. * tree-vect-generic.c: Moved to... * tree-vect-generic.cc: ...here. * tree-vect-loop-manip.c: Moved to... * tree-vect-loop-manip.cc: ...here. * tree-vect-loop.c: Moved to... * tree-vect-loop.cc: ...here. * tree-vect-patterns.c: Moved to... * tree-vect-patterns.cc: ...here. * tree-vect-slp-patterns.c: Moved to... * tree-vect-slp-patterns.cc: ...here. * tree-vect-slp.c: Moved to... * tree-vect-slp.cc: ...here. * tree-vect-stmts.c: Moved to... * tree-vect-stmts.cc: ...here. * tree-vector-builder.c: Moved to... * tree-vector-builder.cc: ...here. * tree-vectorizer.c: Moved to... * tree-vectorizer.cc: ...here. * tree-vrp.c: Moved to... * tree-vrp.cc: ...here. * tree.c: Moved to... * tree.cc: ...here. * tsan.c: Moved to... * tsan.cc: ...here. * typed-splay-tree.c: Moved to... * typed-splay-tree.cc: ...here. * ubsan.c: Moved to... * ubsan.cc: ...here. * valtrack.c: Moved to... * valtrack.cc: ...here. * value-prof.c: Moved to... * value-prof.cc: ...here. * var-tracking.c: Moved to... * var-tracking.cc: ...here. * varasm.c: Moved to... * varasm.cc: ...here. * varpool.c: Moved to... * varpool.cc: ...here. * vec-perm-indices.c: Moved to... * vec-perm-indices.cc: ...here. * vec.c: Moved to... * vec.cc: ...here. * vmsdbgout.c: Moved to... * vmsdbgout.cc: ...here. * vr-values.c: Moved to... * vr-values.cc: ...here. * vtable-verify.c: Moved to... * vtable-verify.cc: ...here. * web.c: Moved to... * web.cc: ...here. * xcoffout.c: Moved to... * xcoffout.cc: ...here. gcc/c-family/ChangeLog: * c-ada-spec.c: Moved to... * c-ada-spec.cc: ...here. * c-attribs.c: Moved to... * c-attribs.cc: ...here. * c-common.c: Moved to... * c-common.cc: ...here. * c-cppbuiltin.c: Moved to... * c-cppbuiltin.cc: ...here. * c-dump.c: Moved to... * c-dump.cc: ...here. * c-format.c: Moved to... * c-format.cc: ...here. * c-gimplify.c: Moved to... * c-gimplify.cc: ...here. * c-indentation.c: Moved to... * c-indentation.cc: ...here. * c-lex.c: Moved to... * c-lex.cc: ...here. * c-omp.c: Moved to... * c-omp.cc: ...here. * c-opts.c: Moved to... * c-opts.cc: ...here. * c-pch.c: Moved to... * c-pch.cc: ...here. * c-ppoutput.c: Moved to... * c-ppoutput.cc: ...here. * c-pragma.c: Moved to... * c-pragma.cc: ...here. * c-pretty-print.c: Moved to... * c-pretty-print.cc: ...here. * c-semantics.c: Moved to... * c-semantics.cc: ...here. * c-ubsan.c: Moved to... * c-ubsan.cc: ...here. * c-warn.c: Moved to... * c-warn.cc: ...here. * cppspec.c: Moved to... * cppspec.cc: ...here. * stub-objc.c: Moved to... * stub-objc.cc: ...here. gcc/c/ChangeLog: * c-aux-info.c: Moved to... * c-aux-info.cc: ...here. * c-convert.c: Moved to... * c-convert.cc: ...here. * c-decl.c: Moved to... * c-decl.cc: ...here. * c-errors.c: Moved to... * c-errors.cc: ...here. * c-fold.c: Moved to... * c-fold.cc: ...here. * c-lang.c: Moved to... * c-lang.cc: ...here. * c-objc-common.c: Moved to... * c-objc-common.cc: ...here. * c-parser.c: Moved to... * c-parser.cc: ...here. * c-typeck.c: Moved to... * c-typeck.cc: ...here. * gccspec.c: Moved to... * gccspec.cc: ...here. * gimple-parser.c: Moved to... * gimple-parser.cc: ...here. gcc/cp/ChangeLog: * call.c: Moved to... * call.cc: ...here. * class.c: Moved to... * class.cc: ...here. * constexpr.c: Moved to... * constexpr.cc: ...here. * cp-gimplify.c: Moved to... * cp-gimplify.cc: ...here. * cp-lang.c: Moved to... * cp-lang.cc: ...here. * cp-objcp-common.c: Moved to... * cp-objcp-common.cc: ...here. * cp-ubsan.c: Moved to... * cp-ubsan.cc: ...here. * cvt.c: Moved to... * cvt.cc: ...here. * cxx-pretty-print.c: Moved to... * cxx-pretty-print.cc: ...here. * decl.c: Moved to... * decl.cc: ...here. * decl2.c: Moved to... * decl2.cc: ...here. * dump.c: Moved to... * dump.cc: ...here. * error.c: Moved to... * error.cc: ...here. * except.c: Moved to... * except.cc: ...here. * expr.c: Moved to... * expr.cc: ...here. * friend.c: Moved to... * friend.cc: ...here. * g++spec.c: Moved to... * g++spec.cc: ...here. * init.c: Moved to... * init.cc: ...here. * lambda.c: Moved to... * lambda.cc: ...here. * lex.c: Moved to... * lex.cc: ...here. * mangle.c: Moved to... * mangle.cc: ...here. * method.c: Moved to... * method.cc: ...here. * name-lookup.c: Moved to... * name-lookup.cc: ...here. * optimize.c: Moved to... * optimize.cc: ...here. * parser.c: Moved to... * parser.cc: ...here. * pt.c: Moved to... * pt.cc: ...here. * ptree.c: Moved to... * ptree.cc: ...here. * rtti.c: Moved to... * rtti.cc: ...here. * search.c: Moved to... * search.cc: ...here. * semantics.c: Moved to... * semantics.cc: ...here. * tree.c: Moved to... * tree.cc: ...here. * typeck.c: Moved to... * typeck.cc: ...here. * typeck2.c: Moved to... * typeck2.cc: ...here. * vtable-class-hierarchy.c: Moved to... * vtable-class-hierarchy.cc: ...here. gcc/fortran/ChangeLog: * arith.c: Moved to... * arith.cc: ...here. * array.c: Moved to... * array.cc: ...here. * bbt.c: Moved to... * bbt.cc: ...here. * check.c: Moved to... * check.cc: ...here. * class.c: Moved to... * class.cc: ...here. * constructor.c: Moved to... * constructor.cc: ...here. * convert.c: Moved to... * convert.cc: ...here. * cpp.c: Moved to... * cpp.cc: ...here. * data.c: Moved to... * data.cc: ...here. * decl.c: Moved to... * decl.cc: ...here. * dependency.c: Moved to... * dependency.cc: ...here. * dump-parse-tree.c: Moved to... * dump-parse-tree.cc: ...here. * error.c: Moved to... * error.cc: ...here. * expr.c: Moved to... * expr.cc: ...here. * f95-lang.c: Moved to... * f95-lang.cc: ...here. * frontend-passes.c: Moved to... * frontend-passes.cc: ...here. * gfortranspec.c: Moved to... * gfortranspec.cc: ...here. * interface.c: Moved to... * interface.cc: ...here. * intrinsic.c: Moved to... * intrinsic.cc: ...here. * io.c: Moved to... * io.cc: ...here. * iresolve.c: Moved to... * iresolve.cc: ...here. * match.c: Moved to... * match.cc: ...here. * matchexp.c: Moved to... * matchexp.cc: ...here. * misc.c: Moved to... * misc.cc: ...here. * module.c: Moved to... * module.cc: ...here. * openmp.c: Moved to... * openmp.cc: ...here. * options.c: Moved to... * options.cc: ...here. * parse.c: Moved to... * parse.cc: ...here. * primary.c: Moved to... * primary.cc: ...here. * resolve.c: Moved to... * resolve.cc: ...here. * scanner.c: Moved to... * scanner.cc: ...here. * simplify.c: Moved to... * simplify.cc: ...here. * st.c: Moved to... * st.cc: ...here. * symbol.c: Moved to... * symbol.cc: ...here. * target-memory.c: Moved to... * target-memory.cc: ...here. * trans-array.c: Moved to... * trans-array.cc: ...here. * trans-common.c: Moved to... * trans-common.cc: ...here. * trans-const.c: Moved to... * trans-const.cc: ...here. * trans-decl.c: Moved to... * trans-decl.cc: ...here. * trans-expr.c: Moved to... * trans-expr.cc: ...here. * trans-intrinsic.c: Moved to... * trans-intrinsic.cc: ...here. * trans-io.c: Moved to... * trans-io.cc: ...here. * trans-openmp.c: Moved to... * trans-openmp.cc: ...here. * trans-stmt.c: Moved to... * trans-stmt.cc: ...here. * trans-types.c: Moved to... * trans-types.cc: ...here. * trans.c: Moved to... * trans.cc: ...here. gcc/go/ChangeLog: * go-backend.c: Moved to... * go-backend.cc: ...here. * go-lang.c: Moved to... * go-lang.cc: ...here. * gospec.c: Moved to... * gospec.cc: ...here. gcc/jit/ChangeLog: * dummy-frontend.c: Moved to... * dummy-frontend.cc: ...here. * jit-builtins.c: Moved to... * jit-builtins.cc: ...here. * jit-logging.c: Moved to... * jit-logging.cc: ...here. * jit-playback.c: Moved to... * jit-playback.cc: ...here. * jit-recording.c: Moved to... * jit-recording.cc: ...here. * jit-result.c: Moved to... * jit-result.cc: ...here. * jit-spec.c: Moved to... * jit-spec.cc: ...here. * jit-tempdir.c: Moved to... * jit-tempdir.cc: ...here. * jit-w32.c: Moved to... * jit-w32.cc: ...here. * libgccjit.c: Moved to... * libgccjit.cc: ...here. gcc/lto/ChangeLog: * common.c: Moved to... * common.cc: ...here. * lto-common.c: Moved to... * lto-common.cc: ...here. * lto-dump.c: Moved to... * lto-dump.cc: ...here. * lto-lang.c: Moved to... * lto-lang.cc: ...here. * lto-object.c: Moved to... * lto-object.cc: ...here. * lto-partition.c: Moved to... * lto-partition.cc: ...here. * lto-symtab.c: Moved to... * lto-symtab.cc: ...here. * lto.c: Moved to... * lto.cc: ...here. gcc/objc/ChangeLog: * objc-act.c: Moved to... * objc-act.cc: ...here. * objc-encoding.c: Moved to... * objc-encoding.cc: ...here. * objc-gnu-runtime-abi-01.c: Moved to... * objc-gnu-runtime-abi-01.cc: ...here. * objc-lang.c: Moved to... * objc-lang.cc: ...here. * objc-map.c: Moved to... * objc-map.cc: ...here. * objc-next-runtime-abi-01.c: Moved to... * objc-next-runtime-abi-01.cc: ...here. * objc-next-runtime-abi-02.c: Moved to... * objc-next-runtime-abi-02.cc: ...here. * objc-runtime-shared-support.c: Moved to... * objc-runtime-shared-support.cc: ...here. gcc/objcp/ChangeLog: * objcp-decl.c: Moved to... * objcp-decl.cc: ...here. * objcp-lang.c: Moved to... * objcp-lang.cc: ...here. libcpp/ChangeLog: * charset.c: Moved to... * charset.cc: ...here. * directives.c: Moved to... * directives.cc: ...here. * errors.c: Moved to... * errors.cc: ...here. * expr.c: Moved to... * expr.cc: ...here. * files.c: Moved to... * files.cc: ...here. * identifiers.c: Moved to... * identifiers.cc: ...here. * init.c: Moved to... * init.cc: ...here. * lex.c: Moved to... * lex.cc: ...here. * line-map.c: Moved to... * line-map.cc: ...here. * macro.c: Moved to... * macro.cc: ...here. * makeucnid.c: Moved to... * makeucnid.cc: ...here. * mkdeps.c: Moved to... * mkdeps.cc: ...here. * pch.c: Moved to... * pch.cc: ...here. * symtab.c: Moved to... * symtab.cc: ...here. * traditional.c: Moved to... * traditional.cc: ...here.
Diffstat (limited to 'gcc/c-family/c-omp.c')
-rw-r--r--gcc/c-family/c-omp.c3265
1 files changed, 0 insertions, 3265 deletions
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
deleted file mode 100644
index 400fd4e..0000000
--- a/gcc/c-family/c-omp.c
+++ /dev/null
@@ -1,3265 +0,0 @@
-/* This file contains routines to construct OpenACC and OpenMP constructs,
- called from parsing in the C and C++ front ends.
-
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
- Contributed by Richard Henderson <rth@redhat.com>,
- 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/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "options.h"
-#include "c-common.h"
-#include "gimple-expr.h"
-#include "c-pragma.h"
-#include "stringpool.h"
-#include "omp-general.h"
-#include "gomp-constants.h"
-#include "memmodel.h"
-#include "attribs.h"
-#include "gimplify.h"
-#include "langhooks.h"
-#include "bitmap.h"
-#include "gimple-fold.h"
-
-
-/* Complete a #pragma oacc wait construct. LOC is the location of
- the #pragma. */
-
-tree
-c_finish_oacc_wait (location_t loc, tree parms, tree clauses)
-{
- const int nparms = list_length (parms);
- tree stmt, t;
- vec<tree, va_gc> *args;
-
- vec_alloc (args, nparms + 2);
- stmt = builtin_decl_explicit (BUILT_IN_GOACC_WAIT);
-
- if (omp_find_clause (clauses, OMP_CLAUSE_ASYNC))
- t = OMP_CLAUSE_ASYNC_EXPR (clauses);
- else
- t = build_int_cst (integer_type_node, GOMP_ASYNC_SYNC);
-
- args->quick_push (t);
- args->quick_push (build_int_cst (integer_type_node, nparms));
-
- for (t = parms; t; t = TREE_CHAIN (t))
- {
- if (TREE_CODE (OMP_CLAUSE_WAIT_EXPR (t)) == INTEGER_CST)
- args->quick_push (build_int_cst (integer_type_node,
- TREE_INT_CST_LOW (OMP_CLAUSE_WAIT_EXPR (t))));
- else
- args->quick_push (OMP_CLAUSE_WAIT_EXPR (t));
- }
-
- stmt = build_call_expr_loc_vec (loc, stmt, args);
-
- vec_free (args);
-
- return stmt;
-}
-
-/* Complete a #pragma omp master construct. STMT is the structured-block
- that follows the pragma. LOC is the location of the #pragma. */
-
-tree
-c_finish_omp_master (location_t loc, tree stmt)
-{
- tree t = add_stmt (build1 (OMP_MASTER, void_type_node, stmt));
- SET_EXPR_LOCATION (t, loc);
- return t;
-}
-
-/* Complete a #pragma omp masked construct. BODY is the structured-block
- that follows the pragma. LOC is the location of the #pragma. */
-
-tree
-c_finish_omp_masked (location_t loc, tree body, tree clauses)
-{
- tree stmt = make_node (OMP_MASKED);
- TREE_TYPE (stmt) = void_type_node;
- OMP_MASKED_BODY (stmt) = body;
- OMP_MASKED_CLAUSES (stmt) = clauses;
- SET_EXPR_LOCATION (stmt, loc);
- return add_stmt (stmt);
-}
-
-/* Complete a #pragma omp taskgroup construct. BODY is the structured-block
- that follows the pragma. LOC is the location of the #pragma. */
-
-tree
-c_finish_omp_taskgroup (location_t loc, tree body, tree clauses)
-{
- tree stmt = make_node (OMP_TASKGROUP);
- TREE_TYPE (stmt) = void_type_node;
- OMP_TASKGROUP_BODY (stmt) = body;
- OMP_TASKGROUP_CLAUSES (stmt) = clauses;
- SET_EXPR_LOCATION (stmt, loc);
- return add_stmt (stmt);
-}
-
-/* Complete a #pragma omp critical construct. BODY is the structured-block
- that follows the pragma, NAME is the identifier in the pragma, or null
- if it was omitted. LOC is the location of the #pragma. */
-
-tree
-c_finish_omp_critical (location_t loc, tree body, tree name, tree clauses)
-{
- gcc_assert (!clauses || OMP_CLAUSE_CODE (clauses) == OMP_CLAUSE_HINT);
- if (name == NULL_TREE
- && clauses != NULL_TREE
- && integer_nonzerop (OMP_CLAUSE_HINT_EXPR (clauses)))
- {
- error_at (OMP_CLAUSE_LOCATION (clauses),
- "%<#pragma omp critical%> with %<hint%> clause requires "
- "a name, except when %<omp_sync_hint_none%> is used");
- return error_mark_node;
- }
-
- tree stmt = make_node (OMP_CRITICAL);
- TREE_TYPE (stmt) = void_type_node;
- OMP_CRITICAL_BODY (stmt) = body;
- OMP_CRITICAL_NAME (stmt) = name;
- OMP_CRITICAL_CLAUSES (stmt) = clauses;
- SET_EXPR_LOCATION (stmt, loc);
- return add_stmt (stmt);
-}
-
-/* Complete a #pragma omp ordered construct. STMT is the structured-block
- that follows the pragma. LOC is the location of the #pragma. */
-
-tree
-c_finish_omp_ordered (location_t loc, tree clauses, tree stmt)
-{
- tree t = make_node (OMP_ORDERED);
- TREE_TYPE (t) = void_type_node;
- OMP_ORDERED_BODY (t) = stmt;
- if (!flag_openmp /* flag_openmp_simd */
- && (OMP_CLAUSE_CODE (clauses) != OMP_CLAUSE_SIMD
- || OMP_CLAUSE_CHAIN (clauses)))
- clauses = build_omp_clause (loc, OMP_CLAUSE_SIMD);
- OMP_ORDERED_CLAUSES (t) = clauses;
- SET_EXPR_LOCATION (t, loc);
- return add_stmt (t);
-}
-
-
-/* Complete a #pragma omp barrier construct. LOC is the location of
- the #pragma. */
-
-void
-c_finish_omp_barrier (location_t loc)
-{
- tree x;
-
- x = builtin_decl_explicit (BUILT_IN_GOMP_BARRIER);
- x = build_call_expr_loc (loc, x, 0);
- add_stmt (x);
-}
-
-
-/* Complete a #pragma omp taskwait construct. LOC is the location of the
- pragma. */
-
-void
-c_finish_omp_taskwait (location_t loc)
-{
- tree x;
-
- x = builtin_decl_explicit (BUILT_IN_GOMP_TASKWAIT);
- x = build_call_expr_loc (loc, x, 0);
- add_stmt (x);
-}
-
-
-/* Complete a #pragma omp taskyield construct. LOC is the location of the
- pragma. */
-
-void
-c_finish_omp_taskyield (location_t loc)
-{
- tree x;
-
- x = builtin_decl_explicit (BUILT_IN_GOMP_TASKYIELD);
- x = build_call_expr_loc (loc, x, 0);
- add_stmt (x);
-}
-
-
-/* Complete a #pragma omp atomic construct. For CODE OMP_ATOMIC
- the expression to be implemented atomically is LHS opcode= RHS.
- For OMP_ATOMIC_READ V = LHS, for OMP_ATOMIC_CAPTURE_{NEW,OLD} LHS
- opcode= RHS with the new or old content of LHS returned.
- LOC is the location of the atomic statement. The value returned
- is either error_mark_node (if the construct was erroneous) or an
- OMP_ATOMIC* node which should be added to the current statement
- tree with add_stmt. If TEST is set, avoid calling save_expr
- or create_tmp_var*. */
-
-tree
-c_finish_omp_atomic (location_t loc, enum tree_code code,
- enum tree_code opcode, tree lhs, tree rhs,
- tree v, tree lhs1, tree rhs1, tree r, bool swapped,
- enum omp_memory_order memory_order, bool weak,
- bool test)
-{
- tree x, type, addr, pre = NULL_TREE, rtmp = NULL_TREE, vtmp = NULL_TREE;
- HOST_WIDE_INT bitpos = 0, bitsize = 0;
- enum tree_code orig_opcode = opcode;
-
- if (lhs == error_mark_node || rhs == error_mark_node
- || v == error_mark_node || lhs1 == error_mark_node
- || rhs1 == error_mark_node || r == error_mark_node)
- return error_mark_node;
-
- /* ??? According to one reading of the OpenMP spec, complex type are
- supported, but there are no atomic stores for any architecture.
- But at least icc 9.0 doesn't support complex types here either.
- And lets not even talk about vector types... */
- type = TREE_TYPE (lhs);
- if (!INTEGRAL_TYPE_P (type)
- && !POINTER_TYPE_P (type)
- && !SCALAR_FLOAT_TYPE_P (type))
- {
- error_at (loc, "invalid expression type for %<#pragma omp atomic%>");
- return error_mark_node;
- }
- if (TYPE_ATOMIC (type))
- {
- error_at (loc, "%<_Atomic%> expression in %<#pragma omp atomic%>");
- return error_mark_node;
- }
- if (r && r != void_list_node && !INTEGRAL_TYPE_P (TREE_TYPE (r)))
- {
- error_at (loc, "%<#pragma omp atomic compare capture%> with non-integral "
- "comparison result");
- return error_mark_node;
- }
-
- if (opcode == RDIV_EXPR)
- opcode = TRUNC_DIV_EXPR;
-
- /* ??? Validate that rhs does not overlap lhs. */
- tree blhs = NULL;
- if (TREE_CODE (lhs) == COMPONENT_REF
- && TREE_CODE (TREE_OPERAND (lhs, 1)) == FIELD_DECL
- && DECL_C_BIT_FIELD (TREE_OPERAND (lhs, 1))
- && DECL_BIT_FIELD_REPRESENTATIVE (TREE_OPERAND (lhs, 1)))
- {
- tree field = TREE_OPERAND (lhs, 1);
- tree repr = DECL_BIT_FIELD_REPRESENTATIVE (field);
- if (tree_fits_uhwi_p (DECL_FIELD_OFFSET (field))
- && tree_fits_uhwi_p (DECL_FIELD_OFFSET (repr)))
- bitpos = (tree_to_uhwi (DECL_FIELD_OFFSET (field))
- - tree_to_uhwi (DECL_FIELD_OFFSET (repr))) * BITS_PER_UNIT;
- else
- bitpos = 0;
- bitpos += (tree_to_uhwi (DECL_FIELD_BIT_OFFSET (field))
- - tree_to_uhwi (DECL_FIELD_BIT_OFFSET (repr)));
- gcc_assert (tree_fits_shwi_p (DECL_SIZE (field)));
- bitsize = tree_to_shwi (DECL_SIZE (field));
- blhs = lhs;
- type = TREE_TYPE (repr);
- lhs = build3 (COMPONENT_REF, TREE_TYPE (repr), TREE_OPERAND (lhs, 0),
- repr, TREE_OPERAND (lhs, 2));
- }
-
- /* Take and save the address of the lhs. From then on we'll reference it
- via indirection. */
- addr = build_unary_op (loc, ADDR_EXPR, lhs, false);
- if (addr == error_mark_node)
- return error_mark_node;
- if (!test)
- addr = save_expr (addr);
- if (!test
- && TREE_CODE (addr) != SAVE_EXPR
- && (TREE_CODE (addr) != ADDR_EXPR
- || !VAR_P (TREE_OPERAND (addr, 0))))
- {
- /* Make sure LHS is simple enough so that goa_lhs_expr_p can recognize
- it even after unsharing function body. */
- tree var = create_tmp_var_raw (TREE_TYPE (addr));
- DECL_CONTEXT (var) = current_function_decl;
- addr = build4 (TARGET_EXPR, TREE_TYPE (addr), var, addr, NULL, NULL);
- }
- tree orig_lhs = lhs;
- lhs = build_indirect_ref (loc, addr, RO_NULL);
- tree new_lhs = lhs;
-
- if (code == OMP_ATOMIC_READ)
- {
- x = build1 (OMP_ATOMIC_READ, type, addr);
- SET_EXPR_LOCATION (x, loc);
- OMP_ATOMIC_MEMORY_ORDER (x) = memory_order;
- gcc_assert (!weak);
- if (blhs)
- x = build3_loc (loc, BIT_FIELD_REF, TREE_TYPE (blhs), x,
- bitsize_int (bitsize), bitsize_int (bitpos));
- return build_modify_expr (loc, v, NULL_TREE, NOP_EXPR,
- loc, x, NULL_TREE);
- }
-
- /* There are lots of warnings, errors, and conversions that need to happen
- in the course of interpreting a statement. Use the normal mechanisms
- to do this, and then take it apart again. */
- if (blhs)
- {
- lhs = build3_loc (loc, BIT_FIELD_REF, TREE_TYPE (blhs), lhs,
- bitsize_int (bitsize), bitsize_int (bitpos));
- if (opcode == COND_EXPR)
- {
- bool save = in_late_binary_op;
- in_late_binary_op = true;
- std::swap (rhs, rhs1);
- rhs1 = build_binary_op (loc, EQ_EXPR, lhs, rhs1, true);
- in_late_binary_op = save;
- }
- else if (swapped)
- rhs = build_binary_op (loc, opcode, rhs, lhs, true);
- else if (opcode != NOP_EXPR)
- rhs = build_binary_op (loc, opcode, lhs, rhs, true);
- opcode = NOP_EXPR;
- }
- else if (opcode == COND_EXPR)
- {
- bool save = in_late_binary_op;
- in_late_binary_op = true;
- std::swap (rhs, rhs1);
- rhs1 = build_binary_op (loc, EQ_EXPR, lhs, rhs1, true);
- in_late_binary_op = save;
- opcode = NOP_EXPR;
- }
- else if (swapped)
- {
- rhs = build_binary_op (loc, opcode, rhs, lhs, true);
- opcode = NOP_EXPR;
- }
- bool save = in_late_binary_op;
- in_late_binary_op = true;
- x = build_modify_expr (loc, blhs ? blhs : lhs, NULL_TREE, opcode,
- loc, rhs, NULL_TREE);
- in_late_binary_op = save;
- if (x == error_mark_node)
- return error_mark_node;
- if (TREE_CODE (x) == COMPOUND_EXPR)
- {
- pre = TREE_OPERAND (x, 0);
- gcc_assert (TREE_CODE (pre) == SAVE_EXPR || tree_invariant_p (pre));
- x = TREE_OPERAND (x, 1);
- }
- gcc_assert (TREE_CODE (x) == MODIFY_EXPR);
- rhs = TREE_OPERAND (x, 1);
-
- if (blhs)
- rhs = build3_loc (loc, BIT_INSERT_EXPR, type, new_lhs,
- rhs, bitsize_int (bitpos));
- if (orig_opcode == COND_EXPR)
- {
- if (error_operand_p (rhs1))
- return error_mark_node;
- gcc_assert (TREE_CODE (rhs1) == EQ_EXPR);
- tree cmptype = TREE_TYPE (TREE_OPERAND (rhs1, 0));
- if (SCALAR_FLOAT_TYPE_P (cmptype) && !test)
- {
- bool clear_padding = false;
- HOST_WIDE_INT non_padding_start = 0;
- HOST_WIDE_INT non_padding_end = 0;
- if (BITS_PER_UNIT == 8
- && CHAR_BIT == 8
- && clear_padding_type_may_have_padding_p (cmptype))
- {
- HOST_WIDE_INT sz = int_size_in_bytes (cmptype), i;
- gcc_assert (sz > 0);
- unsigned char *buf = XALLOCAVEC (unsigned char, sz);
- memset (buf, ~0, sz);
- clear_type_padding_in_mask (cmptype, buf);
- for (i = 0; i < sz; i++)
- if (buf[i] != (unsigned char) ~0)
- {
- clear_padding = true;
- break;
- }
- if (clear_padding && buf[i] == 0)
- {
- /* Try to optimize. In the common case where
- non-padding bits are all continuous and start
- and end at a byte boundary, we can just adjust
- the memcmp call arguments and don't need to
- emit __builtin_clear_padding calls. */
- if (i == 0)
- {
- for (i = 0; i < sz; i++)
- if (buf[i] != 0)
- break;
- if (i < sz && buf[i] == (unsigned char) ~0)
- {
- non_padding_start = i;
- for (; i < sz; i++)
- if (buf[i] != (unsigned char) ~0)
- break;
- }
- else
- i = 0;
- }
- if (i != 0)
- {
- non_padding_end = i;
- for (; i < sz; i++)
- if (buf[i] != 0)
- {
- non_padding_start = 0;
- non_padding_end = 0;
- break;
- }
- }
- }
- }
- tree inttype = NULL_TREE;
- if (!clear_padding && tree_fits_uhwi_p (TYPE_SIZE (cmptype)))
- {
- HOST_WIDE_INT prec = tree_to_uhwi (TYPE_SIZE (cmptype));
- inttype = c_common_type_for_size (prec, 1);
- if (inttype
- && (!tree_int_cst_equal (TYPE_SIZE (cmptype),
- TYPE_SIZE (inttype))
- || TYPE_PRECISION (inttype) != prec))
- inttype = NULL_TREE;
- }
- if (inttype)
- {
- TREE_OPERAND (rhs1, 0)
- = build1_loc (loc, VIEW_CONVERT_EXPR, inttype,
- TREE_OPERAND (rhs1, 0));
- TREE_OPERAND (rhs1, 1)
- = build1_loc (loc, VIEW_CONVERT_EXPR, inttype,
- TREE_OPERAND (rhs1, 1));
- }
- else
- {
- tree pcmptype = build_pointer_type (cmptype);
- tree tmp1 = create_tmp_var_raw (cmptype);
- TREE_ADDRESSABLE (tmp1) = 1;
- DECL_CONTEXT (tmp1) = current_function_decl;
- tmp1 = build4 (TARGET_EXPR, cmptype, tmp1,
- TREE_OPERAND (rhs1, 0), NULL, NULL);
- tmp1 = build1 (ADDR_EXPR, pcmptype, tmp1);
- tree tmp2 = create_tmp_var_raw (cmptype);
- TREE_ADDRESSABLE (tmp2) = 1;
- DECL_CONTEXT (tmp2) = current_function_decl;
- tmp2 = build4 (TARGET_EXPR, cmptype, tmp2,
- TREE_OPERAND (rhs1, 1), NULL, NULL);
- tmp2 = build1 (ADDR_EXPR, pcmptype, tmp2);
- if (non_padding_start)
- {
- tmp1 = build2 (POINTER_PLUS_EXPR, pcmptype, tmp1,
- size_int (non_padding_start));
- tmp2 = build2 (POINTER_PLUS_EXPR, pcmptype, tmp2,
- size_int (non_padding_start));
- }
- tree fndecl = builtin_decl_explicit (BUILT_IN_MEMCMP);
- rhs1 = build_call_expr_loc (loc, fndecl, 3, tmp1, tmp2,
- non_padding_end
- ? size_int (non_padding_end
- - non_padding_start)
- : TYPE_SIZE_UNIT (cmptype));
- rhs1 = build2 (EQ_EXPR, boolean_type_node, rhs1,
- integer_zero_node);
- if (clear_padding && non_padding_end == 0)
- {
- fndecl = builtin_decl_explicit (BUILT_IN_CLEAR_PADDING);
- tree cp1 = build_call_expr_loc (loc, fndecl, 1, tmp1);
- tree cp2 = build_call_expr_loc (loc, fndecl, 1, tmp2);
- rhs1 = omit_two_operands_loc (loc, boolean_type_node,
- rhs1, cp2, cp1);
- }
- }
- }
- if (r && test)
- rtmp = rhs1;
- else if (r)
- {
- tree var = create_tmp_var_raw (boolean_type_node);
- DECL_CONTEXT (var) = current_function_decl;
- rtmp = build4 (TARGET_EXPR, boolean_type_node, var,
- boolean_false_node, NULL, NULL);
- save = in_late_binary_op;
- in_late_binary_op = true;
- x = build_modify_expr (loc, var, NULL_TREE, NOP_EXPR,
- loc, rhs1, NULL_TREE);
- in_late_binary_op = save;
- if (x == error_mark_node)
- return error_mark_node;
- gcc_assert (TREE_CODE (x) == MODIFY_EXPR
- && TREE_OPERAND (x, 0) == var);
- TREE_OPERAND (x, 0) = rtmp;
- rhs1 = omit_one_operand_loc (loc, boolean_type_node, x, rtmp);
- }
- rhs = build3_loc (loc, COND_EXPR, type, rhs1, rhs, new_lhs);
- rhs1 = NULL_TREE;
- }
-
- /* Punt the actual generation of atomic operations to common code. */
- if (code == OMP_ATOMIC)
- type = void_type_node;
- x = build2 (code, type, addr, rhs);
- SET_EXPR_LOCATION (x, loc);
- OMP_ATOMIC_MEMORY_ORDER (x) = memory_order;
- OMP_ATOMIC_WEAK (x) = weak;
-
- /* Generally it is hard to prove lhs1 and lhs are the same memory
- location, just diagnose different variables. */
- if (rhs1
- && VAR_P (rhs1)
- && VAR_P (orig_lhs)
- && rhs1 != orig_lhs
- && !test)
- {
- if (code == OMP_ATOMIC)
- error_at (loc, "%<#pragma omp atomic update%> uses two different "
- "variables for memory");
- else
- error_at (loc, "%<#pragma omp atomic capture%> uses two different "
- "variables for memory");
- return error_mark_node;
- }
-
- if (lhs1
- && lhs1 != orig_lhs
- && TREE_CODE (lhs1) == COMPONENT_REF
- && TREE_CODE (TREE_OPERAND (lhs1, 1)) == FIELD_DECL
- && DECL_C_BIT_FIELD (TREE_OPERAND (lhs1, 1))
- && DECL_BIT_FIELD_REPRESENTATIVE (TREE_OPERAND (lhs1, 1)))
- {
- tree field = TREE_OPERAND (lhs1, 1);
- tree repr = DECL_BIT_FIELD_REPRESENTATIVE (field);
- lhs1 = build3 (COMPONENT_REF, TREE_TYPE (repr), TREE_OPERAND (lhs1, 0),
- repr, TREE_OPERAND (lhs1, 2));
- }
- if (rhs1
- && rhs1 != orig_lhs
- && TREE_CODE (rhs1) == COMPONENT_REF
- && TREE_CODE (TREE_OPERAND (rhs1, 1)) == FIELD_DECL
- && DECL_C_BIT_FIELD (TREE_OPERAND (rhs1, 1))
- && DECL_BIT_FIELD_REPRESENTATIVE (TREE_OPERAND (rhs1, 1)))
- {
- tree field = TREE_OPERAND (rhs1, 1);
- tree repr = DECL_BIT_FIELD_REPRESENTATIVE (field);
- rhs1 = build3 (COMPONENT_REF, TREE_TYPE (repr), TREE_OPERAND (rhs1, 0),
- repr, TREE_OPERAND (rhs1, 2));
- }
-
- if (code != OMP_ATOMIC)
- {
- /* Generally it is hard to prove lhs1 and lhs are the same memory
- location, just diagnose different variables. */
- if (lhs1 && VAR_P (lhs1) && VAR_P (orig_lhs))
- {
- if (lhs1 != orig_lhs && !test)
- {
- error_at (loc, "%<#pragma omp atomic capture%> uses two "
- "different variables for memory");
- return error_mark_node;
- }
- }
- if (blhs)
- x = build3_loc (loc, BIT_FIELD_REF, TREE_TYPE (blhs), x,
- bitsize_int (bitsize), bitsize_int (bitpos));
- if (r && !test)
- {
- vtmp = create_tmp_var_raw (TREE_TYPE (x));
- DECL_CONTEXT (vtmp) = current_function_decl;
- }
- else
- vtmp = v;
- x = build_modify_expr (loc, vtmp, NULL_TREE, NOP_EXPR,
- loc, x, NULL_TREE);
- if (x == error_mark_node)
- return error_mark_node;
- type = TREE_TYPE (x);
- if (r && !test)
- {
- vtmp = build4 (TARGET_EXPR, TREE_TYPE (vtmp), vtmp,
- build_zero_cst (TREE_TYPE (vtmp)), NULL, NULL);
- gcc_assert (TREE_CODE (x) == MODIFY_EXPR
- && TREE_OPERAND (x, 0) == TARGET_EXPR_SLOT (vtmp));
- TREE_OPERAND (x, 0) = vtmp;
- }
- if (rhs1 && rhs1 != orig_lhs)
- {
- tree rhs1addr = build_unary_op (loc, ADDR_EXPR, rhs1, false);
- if (rhs1addr == error_mark_node)
- return error_mark_node;
- x = omit_one_operand_loc (loc, type, x, rhs1addr);
- }
- if (lhs1 && lhs1 != orig_lhs)
- {
- tree lhs1addr = build_unary_op (loc, ADDR_EXPR, lhs1, false);
- if (lhs1addr == error_mark_node)
- return error_mark_node;
- if (code == OMP_ATOMIC_CAPTURE_OLD)
- x = omit_one_operand_loc (loc, type, x, lhs1addr);
- else
- {
- if (!test)
- x = save_expr (x);
- x = omit_two_operands_loc (loc, type, x, x, lhs1addr);
- }
- }
- }
- else if (rhs1 && rhs1 != orig_lhs)
- {
- tree rhs1addr = build_unary_op (loc, ADDR_EXPR, rhs1, false);
- if (rhs1addr == error_mark_node)
- return error_mark_node;
- x = omit_one_operand_loc (loc, type, x, rhs1addr);
- }
-
- if (pre)
- x = omit_one_operand_loc (loc, type, x, pre);
- if (r && r != void_list_node)
- {
- in_late_binary_op = true;
- tree x2 = build_modify_expr (loc, r, NULL_TREE, NOP_EXPR,
- loc, rtmp, NULL_TREE);
- in_late_binary_op = save;
- if (x2 == error_mark_node)
- return error_mark_node;
- x = omit_one_operand_loc (loc, TREE_TYPE (x2), x2, x);
- }
- if (v && vtmp != v)
- {
- in_late_binary_op = true;
- tree x2 = build_modify_expr (loc, v, NULL_TREE, NOP_EXPR,
- loc, vtmp, NULL_TREE);
- in_late_binary_op = save;
- if (x2 == error_mark_node)
- return error_mark_node;
- x2 = build3_loc (loc, COND_EXPR, void_type_node, rtmp,
- void_node, x2);
- x = omit_one_operand_loc (loc, TREE_TYPE (x2), x2, x);
- }
- return x;
-}
-
-
-/* Return true if TYPE is the implementation's omp_depend_t. */
-
-bool
-c_omp_depend_t_p (tree type)
-{
- type = TYPE_MAIN_VARIANT (type);
- return (TREE_CODE (type) == RECORD_TYPE
- && TYPE_NAME (type)
- && ((TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- ? DECL_NAME (TYPE_NAME (type)) : TYPE_NAME (type))
- == get_identifier ("omp_depend_t"))
- && (!TYPE_CONTEXT (type)
- || TREE_CODE (TYPE_CONTEXT (type)) == TRANSLATION_UNIT_DECL)
- && COMPLETE_TYPE_P (type)
- && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && !compare_tree_int (TYPE_SIZE (type),
- 2 * tree_to_uhwi (TYPE_SIZE (ptr_type_node))));
-}
-
-
-/* Complete a #pragma omp depobj construct. LOC is the location of the
- #pragma. */
-
-void
-c_finish_omp_depobj (location_t loc, tree depobj,
- enum omp_clause_depend_kind kind, tree clause)
-{
- tree t = NULL_TREE;
- if (!error_operand_p (depobj))
- {
- if (!c_omp_depend_t_p (TREE_TYPE (depobj)))
- {
- error_at (EXPR_LOC_OR_LOC (depobj, loc),
- "type of %<depobj%> expression is not %<omp_depend_t%>");
- depobj = error_mark_node;
- }
- else if (TYPE_READONLY (TREE_TYPE (depobj)))
- {
- error_at (EXPR_LOC_OR_LOC (depobj, loc),
- "%<const%> qualified %<depobj%> expression");
- depobj = error_mark_node;
- }
- }
- else
- depobj = error_mark_node;
-
- if (clause == error_mark_node)
- return;
-
- if (clause)
- {
- gcc_assert (TREE_CODE (clause) == OMP_CLAUSE
- && OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_DEPEND);
- if (OMP_CLAUSE_CHAIN (clause))
- error_at (OMP_CLAUSE_LOCATION (clause),
- "more than one locator in %<depend%> clause on %<depobj%> "
- "construct");
- switch (OMP_CLAUSE_DEPEND_KIND (clause))
- {
- case OMP_CLAUSE_DEPEND_DEPOBJ:
- error_at (OMP_CLAUSE_LOCATION (clause),
- "%<depobj%> dependence type specified in %<depend%> "
- "clause on %<depobj%> construct");
- return;
- case OMP_CLAUSE_DEPEND_SOURCE:
- case OMP_CLAUSE_DEPEND_SINK:
- error_at (OMP_CLAUSE_LOCATION (clause),
- "%<depend(%s)%> is only allowed in %<omp ordered%>",
- OMP_CLAUSE_DEPEND_KIND (clause) == OMP_CLAUSE_DEPEND_SOURCE
- ? "source" : "sink");
- return;
- case OMP_CLAUSE_DEPEND_IN:
- case OMP_CLAUSE_DEPEND_OUT:
- case OMP_CLAUSE_DEPEND_INOUT:
- case OMP_CLAUSE_DEPEND_MUTEXINOUTSET:
- kind = OMP_CLAUSE_DEPEND_KIND (clause);
- t = OMP_CLAUSE_DECL (clause);
- gcc_assert (t);
- if (TREE_CODE (t) == TREE_LIST
- && TREE_PURPOSE (t)
- && TREE_CODE (TREE_PURPOSE (t)) == TREE_VEC)
- {
- error_at (OMP_CLAUSE_LOCATION (clause),
- "%<iterator%> modifier may not be specified on "
- "%<depobj%> construct");
- return;
- }
- if (TREE_CODE (t) == COMPOUND_EXPR)
- {
- tree t1 = build_fold_addr_expr (TREE_OPERAND (t, 1));
- t = build2 (COMPOUND_EXPR, TREE_TYPE (t1), TREE_OPERAND (t, 0),
- t1);
- }
- else
- t = build_fold_addr_expr (t);
- break;
- default:
- gcc_unreachable ();
- }
- }
- else
- gcc_assert (kind != OMP_CLAUSE_DEPEND_SOURCE);
-
- if (depobj == error_mark_node)
- return;
-
- depobj = build_fold_addr_expr_loc (EXPR_LOC_OR_LOC (depobj, loc), depobj);
- tree dtype
- = build_pointer_type_for_mode (ptr_type_node, TYPE_MODE (ptr_type_node),
- true);
- depobj = fold_convert (dtype, depobj);
- tree r;
- if (clause)
- {
- depobj = save_expr (depobj);
- r = build_indirect_ref (loc, depobj, RO_UNARY_STAR);
- add_stmt (build2 (MODIFY_EXPR, void_type_node, r, t));
- }
- int k;
- switch (kind)
- {
- case OMP_CLAUSE_DEPEND_IN:
- k = GOMP_DEPEND_IN;
- break;
- case OMP_CLAUSE_DEPEND_OUT:
- k = GOMP_DEPEND_OUT;
- break;
- case OMP_CLAUSE_DEPEND_INOUT:
- k = GOMP_DEPEND_INOUT;
- break;
- case OMP_CLAUSE_DEPEND_MUTEXINOUTSET:
- k = GOMP_DEPEND_MUTEXINOUTSET;
- break;
- case OMP_CLAUSE_DEPEND_LAST:
- k = -1;
- break;
- default:
- gcc_unreachable ();
- }
- t = build_int_cst (ptr_type_node, k);
- depobj = build2_loc (loc, POINTER_PLUS_EXPR, TREE_TYPE (depobj), depobj,
- TYPE_SIZE_UNIT (ptr_type_node));
- r = build_indirect_ref (loc, depobj, RO_UNARY_STAR);
- add_stmt (build2 (MODIFY_EXPR, void_type_node, r, t));
-}
-
-
-/* Complete a #pragma omp flush construct. We don't do anything with
- the variable list that the syntax allows. LOC is the location of
- the #pragma. */
-
-void
-c_finish_omp_flush (location_t loc, int mo)
-{
- tree x;
-
- if (mo == MEMMODEL_LAST || mo == MEMMODEL_SEQ_CST)
- {
- x = builtin_decl_explicit (BUILT_IN_SYNC_SYNCHRONIZE);
- x = build_call_expr_loc (loc, x, 0);
- }
- else
- {
- x = builtin_decl_explicit (BUILT_IN_ATOMIC_THREAD_FENCE);
- x = build_call_expr_loc (loc, x, 1,
- build_int_cst (integer_type_node, mo));
- }
- add_stmt (x);
-}
-
-
-/* Check and canonicalize OMP_FOR increment expression.
- Helper function for c_finish_omp_for. */
-
-static tree
-check_omp_for_incr_expr (location_t loc, tree exp, tree decl)
-{
- tree t;
-
- if (!INTEGRAL_TYPE_P (TREE_TYPE (exp))
- || TYPE_PRECISION (TREE_TYPE (exp)) < TYPE_PRECISION (TREE_TYPE (decl)))
- return error_mark_node;
-
- if (exp == decl)
- return build_int_cst (TREE_TYPE (exp), 0);
-
- switch (TREE_CODE (exp))
- {
- CASE_CONVERT:
- t = check_omp_for_incr_expr (loc, TREE_OPERAND (exp, 0), decl);
- if (t != error_mark_node)
- return fold_convert_loc (loc, TREE_TYPE (exp), t);
- break;
- case MINUS_EXPR:
- t = check_omp_for_incr_expr (loc, TREE_OPERAND (exp, 0), decl);
- if (t != error_mark_node)
- return fold_build2_loc (loc, MINUS_EXPR,
- TREE_TYPE (exp), t, TREE_OPERAND (exp, 1));
- break;
- case PLUS_EXPR:
- t = check_omp_for_incr_expr (loc, TREE_OPERAND (exp, 0), decl);
- if (t != error_mark_node)
- return fold_build2_loc (loc, PLUS_EXPR,
- TREE_TYPE (exp), t, TREE_OPERAND (exp, 1));
- t = check_omp_for_incr_expr (loc, TREE_OPERAND (exp, 1), decl);
- if (t != error_mark_node)
- return fold_build2_loc (loc, PLUS_EXPR,
- TREE_TYPE (exp), TREE_OPERAND (exp, 0), t);
- break;
- case COMPOUND_EXPR:
- {
- /* cp_build_modify_expr forces preevaluation of the RHS to make
- sure that it is evaluated before the lvalue-rvalue conversion
- is applied to the LHS. Reconstruct the original expression. */
- tree op0 = TREE_OPERAND (exp, 0);
- if (TREE_CODE (op0) == TARGET_EXPR
- && !VOID_TYPE_P (TREE_TYPE (op0)))
- {
- tree op1 = TREE_OPERAND (exp, 1);
- tree temp = TARGET_EXPR_SLOT (op0);
- if (BINARY_CLASS_P (op1)
- && TREE_OPERAND (op1, 1) == temp)
- {
- op1 = copy_node (op1);
- TREE_OPERAND (op1, 1) = TARGET_EXPR_INITIAL (op0);
- return check_omp_for_incr_expr (loc, op1, decl);
- }
- }
- break;
- }
- default:
- break;
- }
-
- return error_mark_node;
-}
-
-/* If the OMP_FOR increment expression in INCR is of pointer type,
- canonicalize it into an expression handled by gimplify_omp_for()
- and return it. DECL is the iteration variable. */
-
-static tree
-c_omp_for_incr_canonicalize_ptr (location_t loc, tree decl, tree incr)
-{
- if (POINTER_TYPE_P (TREE_TYPE (decl))
- && TREE_OPERAND (incr, 1))
- {
- tree t = fold_convert_loc (loc,
- sizetype, TREE_OPERAND (incr, 1));
-
- if (TREE_CODE (incr) == POSTDECREMENT_EXPR
- || TREE_CODE (incr) == PREDECREMENT_EXPR)
- t = fold_build1_loc (loc, NEGATE_EXPR, sizetype, t);
- t = fold_build_pointer_plus (decl, t);
- incr = build2 (MODIFY_EXPR, void_type_node, decl, t);
- }
- return incr;
-}
-
-/* Validate and generate OMP_FOR.
- DECLV is a vector of iteration variables, for each collapsed loop.
-
- ORIG_DECLV, if non-NULL, is a vector with the original iteration
- variables (prior to any transformations, by say, C++ iterators).
-
- INITV, CONDV and INCRV are vectors containing initialization
- expressions, controlling predicates and increment expressions.
- BODY is the body of the loop and PRE_BODY statements that go before
- the loop. */
-
-tree
-c_finish_omp_for (location_t locus, enum tree_code code, tree declv,
- tree orig_declv, tree initv, tree condv, tree incrv,
- tree body, tree pre_body, bool final_p)
-{
- location_t elocus;
- bool fail = false;
- int i;
-
- gcc_assert (TREE_VEC_LENGTH (declv) == TREE_VEC_LENGTH (initv));
- gcc_assert (TREE_VEC_LENGTH (declv) == TREE_VEC_LENGTH (condv));
- gcc_assert (TREE_VEC_LENGTH (declv) == TREE_VEC_LENGTH (incrv));
- for (i = 0; i < TREE_VEC_LENGTH (declv); i++)
- {
- tree decl = TREE_VEC_ELT (declv, i);
- tree init = TREE_VEC_ELT (initv, i);
- tree cond = TREE_VEC_ELT (condv, i);
- tree incr = TREE_VEC_ELT (incrv, i);
-
- elocus = locus;
- if (EXPR_HAS_LOCATION (init))
- elocus = EXPR_LOCATION (init);
-
- /* Validate the iteration variable. */
- if (!INTEGRAL_TYPE_P (TREE_TYPE (decl))
- && TREE_CODE (TREE_TYPE (decl)) != POINTER_TYPE)
- {
- error_at (elocus, "invalid type for iteration variable %qE", decl);
- fail = true;
- }
- else if (TYPE_ATOMIC (TREE_TYPE (decl)))
- {
- error_at (elocus, "%<_Atomic%> iteration variable %qE", decl);
- fail = true;
- /* _Atomic iterator confuses stuff too much, so we risk ICE
- trying to diagnose it further. */
- continue;
- }
-
- /* In the case of "for (int i = 0...)", init will be a decl. It should
- have a DECL_INITIAL that we can turn into an assignment. */
- if (init == decl)
- {
- elocus = DECL_SOURCE_LOCATION (decl);
-
- init = DECL_INITIAL (decl);
- if (init == NULL)
- {
- error_at (elocus, "%qE is not initialized", decl);
- init = integer_zero_node;
- fail = true;
- }
- DECL_INITIAL (decl) = NULL_TREE;
-
- init = build_modify_expr (elocus, decl, NULL_TREE, NOP_EXPR,
- /* FIXME diagnostics: This should
- be the location of the INIT. */
- elocus,
- init,
- NULL_TREE);
- }
- if (init != error_mark_node)
- {
- gcc_assert (TREE_CODE (init) == MODIFY_EXPR);
- gcc_assert (TREE_OPERAND (init, 0) == decl);
- }
-
- if (cond == NULL_TREE)
- {
- error_at (elocus, "missing controlling predicate");
- fail = true;
- }
- else
- {
- bool cond_ok = false;
-
- /* E.g. C sizeof (vla) could add COMPOUND_EXPRs with
- evaluation of the vla VAR_DECL. We need to readd
- them to the non-decl operand. See PR45784. */
- while (TREE_CODE (cond) == COMPOUND_EXPR)
- cond = TREE_OPERAND (cond, 1);
-
- if (EXPR_HAS_LOCATION (cond))
- elocus = EXPR_LOCATION (cond);
-
- if (TREE_CODE (cond) == LT_EXPR
- || TREE_CODE (cond) == LE_EXPR
- || TREE_CODE (cond) == GT_EXPR
- || TREE_CODE (cond) == GE_EXPR
- || TREE_CODE (cond) == NE_EXPR
- || TREE_CODE (cond) == EQ_EXPR)
- {
- tree op0 = TREE_OPERAND (cond, 0);
- tree op1 = TREE_OPERAND (cond, 1);
-
- /* 2.5.1. The comparison in the condition is computed in
- the type of DECL, otherwise the behavior is undefined.
-
- For example:
- long n; int i;
- i < n;
-
- according to ISO will be evaluated as:
- (long)i < n;
-
- We want to force:
- i < (int)n; */
- if (TREE_CODE (op0) == NOP_EXPR
- && decl == TREE_OPERAND (op0, 0))
- {
- TREE_OPERAND (cond, 0) = TREE_OPERAND (op0, 0);
- TREE_OPERAND (cond, 1)
- = fold_build1_loc (elocus, NOP_EXPR, TREE_TYPE (decl),
- TREE_OPERAND (cond, 1));
- }
- else if (TREE_CODE (op1) == NOP_EXPR
- && decl == TREE_OPERAND (op1, 0))
- {
- TREE_OPERAND (cond, 1) = TREE_OPERAND (op1, 0);
- TREE_OPERAND (cond, 0)
- = fold_build1_loc (elocus, NOP_EXPR, TREE_TYPE (decl),
- TREE_OPERAND (cond, 0));
- }
-
- if (decl == TREE_OPERAND (cond, 0))
- cond_ok = true;
- else if (decl == TREE_OPERAND (cond, 1))
- {
- TREE_SET_CODE (cond,
- swap_tree_comparison (TREE_CODE (cond)));
- TREE_OPERAND (cond, 1) = TREE_OPERAND (cond, 0);
- TREE_OPERAND (cond, 0) = decl;
- cond_ok = true;
- }
-
- if (TREE_CODE (cond) == NE_EXPR
- || TREE_CODE (cond) == EQ_EXPR)
- {
- if (!INTEGRAL_TYPE_P (TREE_TYPE (decl)))
- {
- if (code == OACC_LOOP || TREE_CODE (cond) == EQ_EXPR)
- cond_ok = false;
- }
- else if (operand_equal_p (TREE_OPERAND (cond, 1),
- TYPE_MIN_VALUE (TREE_TYPE (decl)),
- 0))
- TREE_SET_CODE (cond, TREE_CODE (cond) == NE_EXPR
- ? GT_EXPR : LE_EXPR);
- else if (operand_equal_p (TREE_OPERAND (cond, 1),
- TYPE_MAX_VALUE (TREE_TYPE (decl)),
- 0))
- TREE_SET_CODE (cond, TREE_CODE (cond) == NE_EXPR
- ? LT_EXPR : GE_EXPR);
- else if (code == OACC_LOOP || TREE_CODE (cond) == EQ_EXPR)
- cond_ok = false;
- }
-
- if (cond_ok && TREE_VEC_ELT (condv, i) != cond)
- {
- tree ce = NULL_TREE, *pce = &ce;
- tree type = TREE_TYPE (TREE_OPERAND (cond, 1));
- for (tree c = TREE_VEC_ELT (condv, i); c != cond;
- c = TREE_OPERAND (c, 1))
- {
- *pce = build2 (COMPOUND_EXPR, type, TREE_OPERAND (c, 0),
- TREE_OPERAND (cond, 1));
- pce = &TREE_OPERAND (*pce, 1);
- }
- TREE_OPERAND (cond, 1) = ce;
- TREE_VEC_ELT (condv, i) = cond;
- }
- }
-
- if (!cond_ok)
- {
- error_at (elocus, "invalid controlling predicate");
- fail = true;
- }
- }
-
- if (incr == NULL_TREE)
- {
- error_at (elocus, "missing increment expression");
- fail = true;
- }
- else
- {
- bool incr_ok = false;
-
- if (EXPR_HAS_LOCATION (incr))
- elocus = EXPR_LOCATION (incr);
-
- /* Check all the valid increment expressions: v++, v--, ++v, --v,
- v = v + incr, v = incr + v and v = v - incr. */
- switch (TREE_CODE (incr))
- {
- case POSTINCREMENT_EXPR:
- case PREINCREMENT_EXPR:
- case POSTDECREMENT_EXPR:
- case PREDECREMENT_EXPR:
- if (TREE_OPERAND (incr, 0) != decl)
- break;
-
- incr_ok = true;
- if (!fail
- && TREE_CODE (cond) == NE_EXPR
- && TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE
- && TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl)))
- && (TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl))))
- != INTEGER_CST))
- {
- /* For pointer to VLA, transform != into < or >
- depending on whether incr is increment or decrement. */
- if (TREE_CODE (incr) == PREINCREMENT_EXPR
- || TREE_CODE (incr) == POSTINCREMENT_EXPR)
- TREE_SET_CODE (cond, LT_EXPR);
- else
- TREE_SET_CODE (cond, GT_EXPR);
- }
- incr = c_omp_for_incr_canonicalize_ptr (elocus, decl, incr);
- break;
-
- case COMPOUND_EXPR:
- if (TREE_CODE (TREE_OPERAND (incr, 0)) != SAVE_EXPR
- || TREE_CODE (TREE_OPERAND (incr, 1)) != MODIFY_EXPR)
- break;
- incr = TREE_OPERAND (incr, 1);
- /* FALLTHRU */
- case MODIFY_EXPR:
- if (TREE_OPERAND (incr, 0) != decl)
- break;
- if (TREE_OPERAND (incr, 1) == decl)
- break;
- if (TREE_CODE (TREE_OPERAND (incr, 1)) == PLUS_EXPR
- && (TREE_OPERAND (TREE_OPERAND (incr, 1), 0) == decl
- || TREE_OPERAND (TREE_OPERAND (incr, 1), 1) == decl))
- incr_ok = true;
- else if ((TREE_CODE (TREE_OPERAND (incr, 1)) == MINUS_EXPR
- || (TREE_CODE (TREE_OPERAND (incr, 1))
- == POINTER_PLUS_EXPR))
- && TREE_OPERAND (TREE_OPERAND (incr, 1), 0) == decl)
- incr_ok = true;
- else
- {
- tree t = check_omp_for_incr_expr (elocus,
- TREE_OPERAND (incr, 1),
- decl);
- if (t != error_mark_node)
- {
- incr_ok = true;
- t = build2 (PLUS_EXPR, TREE_TYPE (decl), decl, t);
- incr = build2 (MODIFY_EXPR, void_type_node, decl, t);
- }
- }
- if (!fail
- && incr_ok
- && TREE_CODE (cond) == NE_EXPR)
- {
- tree i = TREE_OPERAND (incr, 1);
- i = TREE_OPERAND (i, TREE_OPERAND (i, 0) == decl);
- i = c_fully_fold (i, false, NULL);
- if (!final_p
- && TREE_CODE (i) != INTEGER_CST)
- ;
- else if (TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE)
- {
- tree unit
- = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl)));
- if (unit)
- {
- enum tree_code ccode = GT_EXPR;
- unit = c_fully_fold (unit, false, NULL);
- i = fold_convert (TREE_TYPE (unit), i);
- if (operand_equal_p (unit, i, 0))
- ccode = LT_EXPR;
- if (ccode == GT_EXPR)
- {
- i = fold_unary (NEGATE_EXPR, TREE_TYPE (i), i);
- if (i == NULL_TREE
- || !operand_equal_p (unit, i, 0))
- {
- error_at (elocus,
- "increment is not constant 1 or "
- "-1 for %<!=%> condition");
- fail = true;
- }
- }
- if (TREE_CODE (unit) != INTEGER_CST)
- /* For pointer to VLA, transform != into < or >
- depending on whether the pointer is
- incremented or decremented in each
- iteration. */
- TREE_SET_CODE (cond, ccode);
- }
- }
- else
- {
- if (!integer_onep (i) && !integer_minus_onep (i))
- {
- error_at (elocus,
- "increment is not constant 1 or -1 for"
- " %<!=%> condition");
- fail = true;
- }
- }
- }
- break;
-
- default:
- break;
- }
- if (!incr_ok)
- {
- error_at (elocus, "invalid increment expression");
- fail = true;
- }
- }
-
- TREE_VEC_ELT (initv, i) = init;
- TREE_VEC_ELT (incrv, i) = incr;
- }
-
- if (fail)
- return NULL;
- else
- {
- tree t = make_node (code);
-
- TREE_TYPE (t) = void_type_node;
- OMP_FOR_INIT (t) = initv;
- OMP_FOR_COND (t) = condv;
- OMP_FOR_INCR (t) = incrv;
- OMP_FOR_BODY (t) = body;
- OMP_FOR_PRE_BODY (t) = pre_body;
- OMP_FOR_ORIG_DECLS (t) = orig_declv;
-
- SET_EXPR_LOCATION (t, locus);
- return t;
- }
-}
-
-/* Type for passing data in between c_omp_check_loop_iv and
- c_omp_check_loop_iv_r. */
-
-struct c_omp_check_loop_iv_data
-{
- tree declv;
- bool fail;
- bool maybe_nonrect;
- location_t stmt_loc;
- location_t expr_loc;
- int kind;
- int idx;
- walk_tree_lh lh;
- hash_set<tree> *ppset;
-};
-
-/* Return -1 if DECL is not a loop iterator in loop nest D, otherwise
- return the index of the loop in which it is an iterator.
- Return TREE_VEC_LENGTH (d->declv) if it is a C++ range for iterator. */
-
-static int
-c_omp_is_loop_iterator (tree decl, struct c_omp_check_loop_iv_data *d)
-{
- for (int i = 0; i < TREE_VEC_LENGTH (d->declv); i++)
- if (decl == TREE_VEC_ELT (d->declv, i)
- || (TREE_CODE (TREE_VEC_ELT (d->declv, i)) == TREE_LIST
- && decl == TREE_PURPOSE (TREE_VEC_ELT (d->declv, i))))
- return i;
- else if (TREE_CODE (TREE_VEC_ELT (d->declv, i)) == TREE_LIST
- && TREE_CHAIN (TREE_VEC_ELT (d->declv, i))
- && (TREE_CODE (TREE_CHAIN (TREE_VEC_ELT (d->declv, i)))
- == TREE_VEC)
- && decl == TREE_VEC_ELT (TREE_CHAIN (TREE_VEC_ELT (d->declv,
- i)), 2))
- return TREE_VEC_LENGTH (d->declv);
- return -1;
-}
-
-/* Helper function called via walk_tree, to diagnose uses
- of associated loop IVs inside of lb, b and incr expressions
- of OpenMP loops. */
-
-static tree
-c_omp_check_loop_iv_r (tree *tp, int *walk_subtrees, void *data)
-{
- struct c_omp_check_loop_iv_data *d
- = (struct c_omp_check_loop_iv_data *) data;
- if (DECL_P (*tp))
- {
- int idx = c_omp_is_loop_iterator (*tp, d);
- if (idx == -1)
- return NULL_TREE;
-
- if ((d->kind & 4) && idx < d->idx)
- {
- d->maybe_nonrect = true;
- return NULL_TREE;
- }
-
- if (d->ppset->add (*tp))
- return NULL_TREE;
-
- location_t loc = d->expr_loc;
- if (loc == UNKNOWN_LOCATION)
- loc = d->stmt_loc;
-
- switch (d->kind & 3)
- {
- case 0:
- error_at (loc, "initializer expression refers to "
- "iteration variable %qD", *tp);
- break;
- case 1:
- error_at (loc, "condition expression refers to "
- "iteration variable %qD", *tp);
- break;
- case 2:
- error_at (loc, "increment expression refers to "
- "iteration variable %qD", *tp);
- break;
- }
- d->fail = true;
- }
- else if ((d->kind & 4)
- && TREE_CODE (*tp) != TREE_VEC
- && TREE_CODE (*tp) != PLUS_EXPR
- && TREE_CODE (*tp) != MINUS_EXPR
- && TREE_CODE (*tp) != MULT_EXPR
- && TREE_CODE (*tp) != POINTER_PLUS_EXPR
- && !CONVERT_EXPR_P (*tp))
- {
- *walk_subtrees = 0;
- d->kind &= 3;
- walk_tree_1 (tp, c_omp_check_loop_iv_r, data, NULL, d->lh);
- d->kind |= 4;
- return NULL_TREE;
- }
- else if (d->ppset->add (*tp))
- *walk_subtrees = 0;
- /* Don't walk dtors added by C++ wrap_cleanups_r. */
- else if (TREE_CODE (*tp) == TRY_CATCH_EXPR
- && TRY_CATCH_IS_CLEANUP (*tp))
- {
- *walk_subtrees = 0;
- return walk_tree_1 (&TREE_OPERAND (*tp, 0), c_omp_check_loop_iv_r, data,
- NULL, d->lh);
- }
-
- return NULL_TREE;
-}
-
-/* Check the allowed expressions for non-rectangular loop nest lb and b
- expressions. Return the outer var decl referenced in the expression. */
-
-static tree
-c_omp_check_nonrect_loop_iv (tree *tp, struct c_omp_check_loop_iv_data *d,
- walk_tree_lh lh)
-{
- d->maybe_nonrect = false;
- if (d->fail)
- return NULL_TREE;
-
- hash_set<tree> pset;
- hash_set<tree> *ppset = d->ppset;
- d->ppset = &pset;
-
- tree t = *tp;
- if (TREE_CODE (t) == TREE_VEC
- && TREE_VEC_LENGTH (t) == 3
- && DECL_P (TREE_VEC_ELT (t, 0))
- && c_omp_is_loop_iterator (TREE_VEC_ELT (t, 0), d) >= 0)
- {
- d->kind &= 3;
- walk_tree_1 (&TREE_VEC_ELT (t, 1), c_omp_check_loop_iv_r, d, NULL, lh);
- walk_tree_1 (&TREE_VEC_ELT (t, 1), c_omp_check_loop_iv_r, d, NULL, lh);
- d->ppset = ppset;
- return d->fail ? NULL_TREE : TREE_VEC_ELT (t, 0);
- }
-
- while (CONVERT_EXPR_P (t))
- t = TREE_OPERAND (t, 0);
-
- tree a1 = t, a2 = integer_zero_node;
- bool neg_a1 = false, neg_a2 = false;
- switch (TREE_CODE (t))
- {
- case PLUS_EXPR:
- case MINUS_EXPR:
- a1 = TREE_OPERAND (t, 0);
- a2 = TREE_OPERAND (t, 1);
- while (CONVERT_EXPR_P (a1))
- a1 = TREE_OPERAND (a1, 0);
- while (CONVERT_EXPR_P (a2))
- a2 = TREE_OPERAND (a2, 0);
- if (DECL_P (a1) && c_omp_is_loop_iterator (a1, d) >= 0)
- {
- a2 = TREE_OPERAND (t, 1);
- if (TREE_CODE (t) == MINUS_EXPR)
- neg_a2 = true;
- t = a1;
- break;
- }
- if (DECL_P (a2) && c_omp_is_loop_iterator (a2, d) >= 0)
- {
- a1 = TREE_OPERAND (t, 0);
- if (TREE_CODE (t) == MINUS_EXPR)
- neg_a1 = true;
- t = a2;
- a2 = a1;
- break;
- }
- if (TREE_CODE (a1) == MULT_EXPR && TREE_CODE (a2) == MULT_EXPR)
- {
- tree o1 = TREE_OPERAND (a1, 0);
- tree o2 = TREE_OPERAND (a1, 1);
- while (CONVERT_EXPR_P (o1))
- o1 = TREE_OPERAND (o1, 0);
- while (CONVERT_EXPR_P (o2))
- o2 = TREE_OPERAND (o2, 0);
- if ((DECL_P (o1) && c_omp_is_loop_iterator (o1, d) >= 0)
- || (DECL_P (o2) && c_omp_is_loop_iterator (o2, d) >= 0))
- {
- a2 = TREE_OPERAND (t, 1);
- if (TREE_CODE (t) == MINUS_EXPR)
- neg_a2 = true;
- t = a1;
- break;
- }
- }
- if (TREE_CODE (a2) == MULT_EXPR)
- {
- a1 = TREE_OPERAND (t, 0);
- if (TREE_CODE (t) == MINUS_EXPR)
- neg_a1 = true;
- t = a2;
- a2 = a1;
- break;
- }
- if (TREE_CODE (a1) == MULT_EXPR)
- {
- a2 = TREE_OPERAND (t, 1);
- if (TREE_CODE (t) == MINUS_EXPR)
- neg_a2 = true;
- t = a1;
- break;
- }
- a2 = integer_zero_node;
- break;
- case POINTER_PLUS_EXPR:
- a1 = TREE_OPERAND (t, 0);
- a2 = TREE_OPERAND (t, 1);
- while (CONVERT_EXPR_P (a1))
- a1 = TREE_OPERAND (a1, 0);
- if (DECL_P (a1) && c_omp_is_loop_iterator (a1, d) >= 0)
- {
- a2 = TREE_OPERAND (t, 1);
- t = a1;
- break;
- }
- break;
- default:
- break;
- }
-
- a1 = integer_one_node;
- if (TREE_CODE (t) == MULT_EXPR)
- {
- tree o1 = TREE_OPERAND (t, 0);
- tree o2 = TREE_OPERAND (t, 1);
- while (CONVERT_EXPR_P (o1))
- o1 = TREE_OPERAND (o1, 0);
- while (CONVERT_EXPR_P (o2))
- o2 = TREE_OPERAND (o2, 0);
- if (DECL_P (o1) && c_omp_is_loop_iterator (o1, d) >= 0)
- {
- a1 = TREE_OPERAND (t, 1);
- t = o1;
- }
- else if (DECL_P (o2) && c_omp_is_loop_iterator (o2, d) >= 0)
- {
- a1 = TREE_OPERAND (t, 0);
- t = o2;
- }
- }
-
- d->kind &= 3;
- tree ret = NULL_TREE;
- if (DECL_P (t) && c_omp_is_loop_iterator (t, d) >= 0)
- {
- location_t loc = d->expr_loc;
- if (loc == UNKNOWN_LOCATION)
- loc = d->stmt_loc;
- if (!lang_hooks.types_compatible_p (TREE_TYPE (*tp), TREE_TYPE (t)))
- {
- if (d->kind == 0)
- error_at (loc, "outer iteration variable %qD used in initializer"
- " expression has type other than %qT",
- t, TREE_TYPE (*tp));
- else
- error_at (loc, "outer iteration variable %qD used in condition"
- " expression has type other than %qT",
- t, TREE_TYPE (*tp));
- d->fail = true;
- }
- else if (!INTEGRAL_TYPE_P (TREE_TYPE (a1)))
- {
- error_at (loc, "outer iteration variable %qD multiplier expression"
- " %qE is not integral", t, a1);
- d->fail = true;
- }
- else if (!INTEGRAL_TYPE_P (TREE_TYPE (a2)))
- {
- error_at (loc, "outer iteration variable %qD addend expression"
- " %qE is not integral", t, a2);
- d->fail = true;
- }
- else
- {
- walk_tree_1 (&a1, c_omp_check_loop_iv_r, d, NULL, lh);
- walk_tree_1 (&a2, c_omp_check_loop_iv_r, d, NULL, lh);
- }
- if (!d->fail)
- {
- a1 = fold_convert (TREE_TYPE (*tp), a1);
- a2 = fold_convert (TREE_TYPE (*tp), a2);
- if (neg_a1)
- a1 = fold_build1 (NEGATE_EXPR, TREE_TYPE (a1), a1);
- if (neg_a2)
- a2 = fold_build1 (NEGATE_EXPR, TREE_TYPE (a2), a2);
- ret = t;
- *tp = make_tree_vec (3);
- TREE_VEC_ELT (*tp, 0) = t;
- TREE_VEC_ELT (*tp, 1) = a1;
- TREE_VEC_ELT (*tp, 2) = a2;
- }
- }
- else
- walk_tree_1 (&t, c_omp_check_loop_iv_r, d, NULL, lh);
-
- d->ppset = ppset;
- return ret;
-}
-
-/* Diagnose invalid references to loop iterators in lb, b and incr
- expressions. */
-
-bool
-c_omp_check_loop_iv (tree stmt, tree declv, walk_tree_lh lh)
-{
- hash_set<tree> pset;
- struct c_omp_check_loop_iv_data data;
- int i;
-
- data.declv = declv;
- data.fail = false;
- data.maybe_nonrect = false;
- data.stmt_loc = EXPR_LOCATION (stmt);
- data.lh = lh;
- data.ppset = &pset;
- for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (stmt)); i++)
- {
- tree init = TREE_VEC_ELT (OMP_FOR_INIT (stmt), i);
- gcc_assert (TREE_CODE (init) == MODIFY_EXPR);
- tree decl = TREE_OPERAND (init, 0);
- tree cond = TREE_VEC_ELT (OMP_FOR_COND (stmt), i);
- gcc_assert (COMPARISON_CLASS_P (cond));
- gcc_assert (TREE_OPERAND (cond, 0) == decl);
- tree incr = TREE_VEC_ELT (OMP_FOR_INCR (stmt), i);
- data.expr_loc = EXPR_LOCATION (TREE_OPERAND (init, 1));
- tree vec_outer1 = NULL_TREE, vec_outer2 = NULL_TREE;
- int kind = 0;
- if (i > 0
- && (unsigned) c_omp_is_loop_iterator (decl, &data) < (unsigned) i)
- {
- location_t loc = data.expr_loc;
- if (loc == UNKNOWN_LOCATION)
- loc = data.stmt_loc;
- error_at (loc, "the same loop iteration variables %qD used in "
- "multiple associated loops", decl);
- data.fail = true;
- }
- /* Handle non-rectangular loop nests. */
- if (TREE_CODE (stmt) != OACC_LOOP && i > 0)
- kind = 4;
- data.kind = kind;
- data.idx = i;
- walk_tree_1 (&TREE_OPERAND (init, 1),
- c_omp_check_loop_iv_r, &data, NULL, lh);
- if (data.maybe_nonrect)
- vec_outer1 = c_omp_check_nonrect_loop_iv (&TREE_OPERAND (init, 1),
- &data, lh);
- /* Don't warn for C++ random access iterators here, the
- expression then involves the subtraction and always refers
- to the original value. The C++ FE needs to warn on those
- earlier. */
- if (decl == TREE_VEC_ELT (declv, i)
- || (TREE_CODE (TREE_VEC_ELT (declv, i)) == TREE_LIST
- && decl == TREE_PURPOSE (TREE_VEC_ELT (declv, i))))
- {
- data.expr_loc = EXPR_LOCATION (cond);
- data.kind = kind | 1;
- walk_tree_1 (&TREE_OPERAND (cond, 1),
- c_omp_check_loop_iv_r, &data, NULL, lh);
- if (data.maybe_nonrect)
- vec_outer2 = c_omp_check_nonrect_loop_iv (&TREE_OPERAND (cond, 1),
- &data, lh);
- }
- if (vec_outer1 && vec_outer2 && vec_outer1 != vec_outer2)
- {
- location_t loc = data.expr_loc;
- if (loc == UNKNOWN_LOCATION)
- loc = data.stmt_loc;
- error_at (loc, "two different outer iteration variables %qD and %qD"
- " used in a single loop", vec_outer1, vec_outer2);
- data.fail = true;
- }
- if (vec_outer1 || vec_outer2)
- OMP_FOR_NON_RECTANGULAR (stmt) = 1;
- if (TREE_CODE (incr) == MODIFY_EXPR)
- {
- gcc_assert (TREE_OPERAND (incr, 0) == decl);
- incr = TREE_OPERAND (incr, 1);
- data.kind = 2;
- if (TREE_CODE (incr) == PLUS_EXPR
- && TREE_OPERAND (incr, 1) == decl)
- {
- data.expr_loc = EXPR_LOCATION (TREE_OPERAND (incr, 0));
- walk_tree_1 (&TREE_OPERAND (incr, 0),
- c_omp_check_loop_iv_r, &data, NULL, lh);
- }
- else
- {
- data.expr_loc = EXPR_LOCATION (TREE_OPERAND (incr, 1));
- walk_tree_1 (&TREE_OPERAND (incr, 1),
- c_omp_check_loop_iv_r, &data, NULL, lh);
- }
- }
- }
- return !data.fail;
-}
-
-/* Similar, but allows to check the init or cond expressions individually. */
-
-bool
-c_omp_check_loop_iv_exprs (location_t stmt_loc, enum tree_code code,
- tree declv, int i, tree decl, tree init, tree cond,
- walk_tree_lh lh)
-{
- hash_set<tree> pset;
- struct c_omp_check_loop_iv_data data;
- int kind = (code != OACC_LOOP && i > 0) ? 4 : 0;
-
- data.declv = declv;
- data.fail = false;
- data.maybe_nonrect = false;
- data.stmt_loc = stmt_loc;
- data.lh = lh;
- data.ppset = &pset;
- data.idx = i;
- if (i > 0
- && (unsigned) c_omp_is_loop_iterator (decl, &data) < (unsigned) i)
- {
- error_at (stmt_loc, "the same loop iteration variables %qD used in "
- "multiple associated loops", decl);
- data.fail = true;
- }
- if (init)
- {
- data.expr_loc = EXPR_LOCATION (init);
- data.kind = kind;
- walk_tree_1 (&init,
- c_omp_check_loop_iv_r, &data, NULL, lh);
- }
- if (cond)
- {
- gcc_assert (COMPARISON_CLASS_P (cond));
- data.expr_loc = EXPR_LOCATION (init);
- data.kind = kind | 1;
- if (TREE_OPERAND (cond, 0) == decl)
- walk_tree_1 (&TREE_OPERAND (cond, 1),
- c_omp_check_loop_iv_r, &data, NULL, lh);
- else
- walk_tree_1 (&TREE_OPERAND (cond, 0),
- c_omp_check_loop_iv_r, &data, NULL, lh);
- }
- return !data.fail;
-}
-
-/* This function splits clauses for OpenACC combined loop
- constructs. OpenACC combined loop constructs are:
- #pragma acc kernels loop
- #pragma acc parallel loop */
-
-tree
-c_oacc_split_loop_clauses (tree clauses, tree *not_loop_clauses,
- bool is_parallel)
-{
- tree next, loop_clauses, nc;
-
- loop_clauses = *not_loop_clauses = NULL_TREE;
- for (; clauses ; clauses = next)
- {
- next = OMP_CLAUSE_CHAIN (clauses);
-
- switch (OMP_CLAUSE_CODE (clauses))
- {
- /* Loop clauses. */
- case OMP_CLAUSE_COLLAPSE:
- case OMP_CLAUSE_TILE:
- case OMP_CLAUSE_GANG:
- case OMP_CLAUSE_WORKER:
- case OMP_CLAUSE_VECTOR:
- case OMP_CLAUSE_AUTO:
- case OMP_CLAUSE_SEQ:
- case OMP_CLAUSE_INDEPENDENT:
- case OMP_CLAUSE_PRIVATE:
- OMP_CLAUSE_CHAIN (clauses) = loop_clauses;
- loop_clauses = clauses;
- break;
-
- /* Reductions must be duplicated on both constructs. */
- case OMP_CLAUSE_REDUCTION:
- if (is_parallel)
- {
- nc = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_REDUCTION);
- OMP_CLAUSE_DECL (nc) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_REDUCTION_CODE (nc)
- = OMP_CLAUSE_REDUCTION_CODE (clauses);
- OMP_CLAUSE_CHAIN (nc) = *not_loop_clauses;
- *not_loop_clauses = nc;
- }
-
- OMP_CLAUSE_CHAIN (clauses) = loop_clauses;
- loop_clauses = clauses;
- break;
-
- /* Parallel/kernels clauses. */
- default:
- OMP_CLAUSE_CHAIN (clauses) = *not_loop_clauses;
- *not_loop_clauses = clauses;
- break;
- }
- }
-
- return loop_clauses;
-}
-
-/* This function attempts to split or duplicate clauses for OpenMP
- combined/composite constructs. Right now there are 30 different
- constructs. CODE is the innermost construct in the combined construct,
- and MASK allows to determine which constructs are combined together,
- as every construct has at least one clause that no other construct
- has (except for OMP_SECTIONS, but that can be only combined with parallel,
- and OMP_MASTER, which doesn't have any clauses at all).
- OpenMP combined/composite constructs are:
- #pragma omp distribute parallel for
- #pragma omp distribute parallel for simd
- #pragma omp distribute simd
- #pragma omp for simd
- #pragma omp masked taskloop
- #pragma omp masked taskloop simd
- #pragma omp master taskloop
- #pragma omp master taskloop simd
- #pragma omp parallel for
- #pragma omp parallel for simd
- #pragma omp parallel loop
- #pragma omp parallel masked
- #pragma omp parallel masked taskloop
- #pragma omp parallel masked taskloop simd
- #pragma omp parallel master
- #pragma omp parallel master taskloop
- #pragma omp parallel master taskloop simd
- #pragma omp parallel sections
- #pragma omp target parallel
- #pragma omp target parallel for
- #pragma omp target parallel for simd
- #pragma omp target parallel loop
- #pragma omp target teams
- #pragma omp target teams distribute
- #pragma omp target teams distribute parallel for
- #pragma omp target teams distribute parallel for simd
- #pragma omp target teams distribute simd
- #pragma omp target teams loop
- #pragma omp target simd
- #pragma omp taskloop simd
- #pragma omp teams distribute
- #pragma omp teams distribute parallel for
- #pragma omp teams distribute parallel for simd
- #pragma omp teams distribute simd
- #pragma omp teams loop */
-
-void
-c_omp_split_clauses (location_t loc, enum tree_code code,
- omp_clause_mask mask, tree clauses, tree *cclauses)
-{
- tree next, c;
- enum c_omp_clause_split s;
- int i;
- bool has_dup_allocate = false;
-
- for (i = 0; i < C_OMP_CLAUSE_SPLIT_COUNT; i++)
- cclauses[i] = NULL;
- /* Add implicit nowait clause on
- #pragma omp parallel {for,for simd,sections}. */
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS)) != 0)
- switch (code)
- {
- case OMP_FOR:
- case OMP_SIMD:
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)) != 0)
- cclauses[C_OMP_CLAUSE_SPLIT_FOR]
- = build_omp_clause (loc, OMP_CLAUSE_NOWAIT);
- break;
- case OMP_SECTIONS:
- cclauses[C_OMP_CLAUSE_SPLIT_SECTIONS]
- = build_omp_clause (loc, OMP_CLAUSE_NOWAIT);
- break;
- default:
- break;
- }
-
- for (; clauses ; clauses = next)
- {
- next = OMP_CLAUSE_CHAIN (clauses);
-
- switch (OMP_CLAUSE_CODE (clauses))
- {
- /* First the clauses that are unique to some constructs. */
- case OMP_CLAUSE_DEVICE:
- case OMP_CLAUSE_MAP:
- case OMP_CLAUSE_IS_DEVICE_PTR:
- case OMP_CLAUSE_DEFAULTMAP:
- case OMP_CLAUSE_DEPEND:
- s = C_OMP_CLAUSE_SPLIT_TARGET;
- break;
- case OMP_CLAUSE_NUM_TEAMS:
- s = C_OMP_CLAUSE_SPLIT_TEAMS;
- break;
- case OMP_CLAUSE_DIST_SCHEDULE:
- s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE;
- break;
- case OMP_CLAUSE_COPYIN:
- case OMP_CLAUSE_NUM_THREADS:
- case OMP_CLAUSE_PROC_BIND:
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- break;
- case OMP_CLAUSE_ORDERED:
- s = C_OMP_CLAUSE_SPLIT_FOR;
- break;
- case OMP_CLAUSE_SCHEDULE:
- s = C_OMP_CLAUSE_SPLIT_FOR;
- if (code != OMP_SIMD)
- OMP_CLAUSE_SCHEDULE_SIMD (clauses) = 0;
- break;
- case OMP_CLAUSE_SAFELEN:
- case OMP_CLAUSE_SIMDLEN:
- case OMP_CLAUSE_ALIGNED:
- case OMP_CLAUSE_NONTEMPORAL:
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- break;
- case OMP_CLAUSE_GRAINSIZE:
- case OMP_CLAUSE_NUM_TASKS:
- case OMP_CLAUSE_FINAL:
- case OMP_CLAUSE_UNTIED:
- case OMP_CLAUSE_MERGEABLE:
- case OMP_CLAUSE_NOGROUP:
- case OMP_CLAUSE_PRIORITY:
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- break;
- case OMP_CLAUSE_BIND:
- s = C_OMP_CLAUSE_SPLIT_LOOP;
- break;
- case OMP_CLAUSE_FILTER:
- s = C_OMP_CLAUSE_SPLIT_MASKED;
- break;
- /* Duplicate this to all of taskloop, distribute, for, simd and
- loop. */
- case OMP_CLAUSE_COLLAPSE:
- if (code == OMP_SIMD)
- {
- if ((mask & ((OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)
- | (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)
- | (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NOGROUP))) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_COLLAPSE);
- OMP_CLAUSE_COLLAPSE_EXPR (c)
- = OMP_CLAUSE_COLLAPSE_EXPR (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_SIMD];
- cclauses[C_OMP_CLAUSE_SPLIT_SIMD] = c;
- }
- else
- {
- /* This must be #pragma omp target simd */
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- break;
- }
- }
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)) != 0)
- {
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_COLLAPSE);
- OMP_CLAUSE_COLLAPSE_EXPR (c)
- = OMP_CLAUSE_COLLAPSE_EXPR (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_FOR];
- cclauses[C_OMP_CLAUSE_SPLIT_FOR] = c;
- s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE;
- }
- else
- s = C_OMP_CLAUSE_SPLIT_FOR;
- }
- else if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))
- != 0)
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- else if (code == OMP_LOOP)
- s = C_OMP_CLAUSE_SPLIT_LOOP;
- else
- s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE;
- break;
- /* Private clause is supported on all constructs but master/masked,
- it is enough to put it on the innermost one other than
- master/masked. For #pragma omp {for,sections} put it on parallel
- though, as that's what we did for OpenMP 3.1. */
- case OMP_CLAUSE_PRIVATE:
- switch (code)
- {
- case OMP_SIMD: s = C_OMP_CLAUSE_SPLIT_SIMD; break;
- case OMP_FOR: case OMP_SECTIONS:
- case OMP_PARALLEL: s = C_OMP_CLAUSE_SPLIT_PARALLEL; break;
- case OMP_DISTRIBUTE: s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE; break;
- case OMP_TEAMS: s = C_OMP_CLAUSE_SPLIT_TEAMS; break;
- case OMP_MASTER: s = C_OMP_CLAUSE_SPLIT_PARALLEL; break;
- case OMP_MASKED: s = C_OMP_CLAUSE_SPLIT_PARALLEL; break;
- case OMP_TASKLOOP: s = C_OMP_CLAUSE_SPLIT_TASKLOOP; break;
- case OMP_LOOP: s = C_OMP_CLAUSE_SPLIT_LOOP; break;
- default: gcc_unreachable ();
- }
- break;
- /* Firstprivate clause is supported on all constructs but
- simd, master, masked and loop. Put it on the outermost of those
- and duplicate on teams and parallel. */
- case OMP_CLAUSE_FIRSTPRIVATE:
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP))
- != 0)
- {
- if (code == OMP_SIMD
- && (mask & ((OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_THREADS)
- | (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_TEAMS))) == 0)
- {
- /* This must be #pragma omp target simd. */
- s = C_OMP_CLAUSE_SPLIT_TARGET;
- OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT (clauses) = 1;
- OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET (clauses) = 1;
- break;
- }
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_FIRSTPRIVATE);
- /* firstprivate should not be applied to target if it is
- also lastprivate or on the combined/composite construct,
- or if it is mentioned in map clause. OMP_CLAUSE_DECLs
- may need to go through FE handling though (instantiation,
- C++ non-static data members, array section lowering), so
- add the clause with OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT and
- let *finish_omp_clauses and the gimplifier handle it
- right. */
- OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT (c) = 1;
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TARGET];
- cclauses[C_OMP_CLAUSE_SPLIT_TARGET] = c;
- }
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS))
- != 0)
- {
- if ((mask & ((OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS)
- | (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE))) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL];
- cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL] = c;
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_TEAMS)) != 0)
- s = C_OMP_CLAUSE_SPLIT_TEAMS;
- else
- s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE;
- }
- else if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NOGROUP)) != 0)
- /* This must be
- #pragma omp parallel mas{ked,ter} taskloop{, simd}. */
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- else
- /* This must be
- #pragma omp parallel{, for{, simd}, sections,loop}
- or
- #pragma omp target parallel. */
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- }
- else if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS))
- != 0)
- {
- /* This must be one of
- #pragma omp {,target }teams {distribute,loop}
- #pragma omp target teams
- #pragma omp {,target }teams distribute simd. */
- gcc_assert (code == OMP_DISTRIBUTE
- || code == OMP_LOOP
- || code == OMP_TEAMS
- || code == OMP_SIMD);
- s = C_OMP_CLAUSE_SPLIT_TEAMS;
- }
- else if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)) != 0)
- {
- /* This must be #pragma omp distribute simd. */
- gcc_assert (code == OMP_SIMD);
- s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE;
- }
- else if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NOGROUP)) != 0)
- {
- /* This must be
- #pragma omp {,{,parallel }mas{ked,ter} }taskloop simd
- or
- #pragma omp {,parallel }mas{ked,ter} taskloop. */
- gcc_assert (code == OMP_SIMD || code == OMP_TASKLOOP);
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- }
- else
- {
- /* This must be #pragma omp for simd. */
- gcc_assert (code == OMP_SIMD);
- s = C_OMP_CLAUSE_SPLIT_FOR;
- }
- break;
- /* Lastprivate is allowed on distribute, for, sections, taskloop, loop
- and simd. In parallel {for{, simd},sections} we actually want to
- put it on parallel rather than for or sections. */
- case OMP_CLAUSE_LASTPRIVATE:
- if (code == OMP_DISTRIBUTE)
- {
- s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE;
- break;
- }
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_LASTPRIVATE);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_DISTRIBUTE];
- OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c)
- = OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (clauses);
- cclauses[C_OMP_CLAUSE_SPLIT_DISTRIBUTE] = c;
- }
- if (code == OMP_FOR || code == OMP_SECTIONS)
- {
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS))
- != 0)
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- else
- s = C_OMP_CLAUSE_SPLIT_FOR;
- break;
- }
- if (code == OMP_TASKLOOP)
- {
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- break;
- }
- if (code == OMP_LOOP)
- {
- s = C_OMP_CLAUSE_SPLIT_LOOP;
- break;
- }
- gcc_assert (code == OMP_SIMD);
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_LASTPRIVATE);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c)
- = OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (clauses);
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS))
- != 0)
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- else
- s = C_OMP_CLAUSE_SPLIT_FOR;
- OMP_CLAUSE_CHAIN (c) = cclauses[s];
- cclauses[s] = c;
- }
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP)) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_LASTPRIVATE);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c)
- = OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TASKLOOP];
- cclauses[C_OMP_CLAUSE_SPLIT_TASKLOOP] = c;
- }
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- break;
- /* Shared and default clauses are allowed on parallel, teams and
- taskloop. */
- case OMP_CLAUSE_SHARED:
- case OMP_CLAUSE_DEFAULT:
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))
- != 0)
- {
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS))
- != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_CODE (clauses));
- if (OMP_CLAUSE_CODE (clauses) == OMP_CLAUSE_SHARED)
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- else
- OMP_CLAUSE_DEFAULT_KIND (c)
- = OMP_CLAUSE_DEFAULT_KIND (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL];
- cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL] = c;
- }
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- break;
- }
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS))
- != 0)
- {
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS))
- == 0)
- {
- s = C_OMP_CLAUSE_SPLIT_TEAMS;
- break;
- }
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_CODE (clauses));
- if (OMP_CLAUSE_CODE (clauses) == OMP_CLAUSE_SHARED)
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- else
- OMP_CLAUSE_DEFAULT_KIND (c)
- = OMP_CLAUSE_DEFAULT_KIND (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TEAMS];
- cclauses[C_OMP_CLAUSE_SPLIT_TEAMS] = c;
- }
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- break;
- /* order clauses are allowed on distribute, for, simd and loop. */
- case OMP_CLAUSE_ORDER:
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)) != 0)
- {
- if (code == OMP_DISTRIBUTE)
- {
- s = C_OMP_CLAUSE_SPLIT_DISTRIBUTE;
- break;
- }
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_ORDER);
- OMP_CLAUSE_ORDER_UNCONSTRAINED (c)
- = OMP_CLAUSE_ORDER_UNCONSTRAINED (clauses);
- OMP_CLAUSE_ORDER_REPRODUCIBLE (c)
- = OMP_CLAUSE_ORDER_REPRODUCIBLE (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_DISTRIBUTE];
- cclauses[C_OMP_CLAUSE_SPLIT_DISTRIBUTE] = c;
- }
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)) != 0)
- {
- if (code == OMP_SIMD)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_ORDER);
- OMP_CLAUSE_ORDER_UNCONSTRAINED (c)
- = OMP_CLAUSE_ORDER_UNCONSTRAINED (clauses);
- OMP_CLAUSE_ORDER_REPRODUCIBLE (c)
- = OMP_CLAUSE_ORDER_REPRODUCIBLE (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_FOR];
- cclauses[C_OMP_CLAUSE_SPLIT_FOR] = c;
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- }
- else
- s = C_OMP_CLAUSE_SPLIT_FOR;
- }
- else if (code == OMP_LOOP)
- s = C_OMP_CLAUSE_SPLIT_LOOP;
- else
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- break;
- /* Reduction is allowed on simd, for, parallel, sections, taskloop,
- teams and loop. Duplicate it on all of them, but omit on for or
- sections if parallel is present (unless inscan, in that case
- omit on parallel). If taskloop or loop is combined with
- parallel, omit it on parallel. */
- case OMP_CLAUSE_REDUCTION:
- if (OMP_CLAUSE_REDUCTION_TASK (clauses))
- {
- if (code == OMP_SIMD || code == OMP_LOOP)
- {
- error_at (OMP_CLAUSE_LOCATION (clauses),
- "invalid %<task%> reduction modifier on construct "
- "combined with %<simd%> or %<loop%>");
- OMP_CLAUSE_REDUCTION_TASK (clauses) = 0;
- }
- else if (code != OMP_SECTIONS
- && (mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_THREADS)) == 0
- && (mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_SCHEDULE)) == 0)
- {
- error_at (OMP_CLAUSE_LOCATION (clauses),
- "invalid %<task%> reduction modifier on construct "
- "not combined with %<parallel%>, %<for%> or "
- "%<sections%>");
- OMP_CLAUSE_REDUCTION_TASK (clauses) = 0;
- }
- }
- if (OMP_CLAUSE_REDUCTION_INSCAN (clauses)
- && ((mask & ((OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)
- | (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)))
- != 0))
- {
- error_at (OMP_CLAUSE_LOCATION (clauses),
- "%<inscan%> %<reduction%> clause on construct other "
- "than %<for%>, %<simd%>, %<for simd%>, "
- "%<parallel for%>, %<parallel for simd%>");
- OMP_CLAUSE_REDUCTION_INSCAN (clauses) = 0;
- }
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_MAP);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_SET_MAP_KIND (c, GOMP_MAP_TOFROM);
- OMP_CLAUSE_MAP_IMPLICIT (c) = 1;
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TARGET];
- cclauses[C_OMP_CLAUSE_SPLIT_TARGET] = c;
- }
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)) != 0)
- {
- if (code == OMP_SIMD)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_REDUCTION);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_REDUCTION_CODE (c)
- = OMP_CLAUSE_REDUCTION_CODE (clauses);
- OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_PLACEHOLDER (clauses);
- OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (clauses);
- OMP_CLAUSE_REDUCTION_INSCAN (c)
- = OMP_CLAUSE_REDUCTION_INSCAN (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_SIMD];
- cclauses[C_OMP_CLAUSE_SPLIT_SIMD] = c;
- }
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS))
- != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_REDUCTION);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_REDUCTION_CODE (c)
- = OMP_CLAUSE_REDUCTION_CODE (clauses);
- OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_PLACEHOLDER (clauses);
- OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (clauses);
- OMP_CLAUSE_REDUCTION_INSCAN (c)
- = OMP_CLAUSE_REDUCTION_INSCAN (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TEAMS];
- cclauses[C_OMP_CLAUSE_SPLIT_TEAMS] = c;
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- }
- else if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_THREADS)) != 0
- && !OMP_CLAUSE_REDUCTION_INSCAN (clauses))
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- else
- s = C_OMP_CLAUSE_SPLIT_FOR;
- }
- else if (code == OMP_SECTIONS
- || code == OMP_PARALLEL
- || code == OMP_MASTER
- || code == OMP_MASKED)
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- else if (code == OMP_TASKLOOP)
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- else if (code == OMP_LOOP)
- s = C_OMP_CLAUSE_SPLIT_LOOP;
- else if (code == OMP_SIMD)
- {
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))
- != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_REDUCTION);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_REDUCTION_CODE (c)
- = OMP_CLAUSE_REDUCTION_CODE (clauses);
- OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_PLACEHOLDER (clauses);
- OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (clauses);
- OMP_CLAUSE_REDUCTION_INSCAN (c)
- = OMP_CLAUSE_REDUCTION_INSCAN (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TASKLOOP];
- cclauses[C_OMP_CLAUSE_SPLIT_TASKLOOP] = c;
- }
- else if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_TEAMS)) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_REDUCTION);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_REDUCTION_CODE (c)
- = OMP_CLAUSE_REDUCTION_CODE (clauses);
- OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_PLACEHOLDER (clauses);
- OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (clauses);
- OMP_CLAUSE_REDUCTION_INSCAN (c)
- = OMP_CLAUSE_REDUCTION_INSCAN (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TEAMS];
- cclauses[C_OMP_CLAUSE_SPLIT_TEAMS] = c;
- }
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- }
- else
- s = C_OMP_CLAUSE_SPLIT_TEAMS;
- break;
- case OMP_CLAUSE_IN_REDUCTION:
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)) != 0)
- {
- /* When on target, map(always, tofrom: item) is added as
- well. For non-combined target it is added in the FEs. */
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_MAP);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_SET_MAP_KIND (c, GOMP_MAP_ALWAYS_TOFROM);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TARGET];
- cclauses[C_OMP_CLAUSE_SPLIT_TARGET] = c;
- s = C_OMP_CLAUSE_SPLIT_TARGET;
- break;
- }
- /* in_reduction on taskloop simd becomes reduction on the simd
- and keeps being in_reduction on taskloop. */
- if (code == OMP_SIMD)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_REDUCTION);
- OMP_CLAUSE_DECL (c) = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_REDUCTION_CODE (c)
- = OMP_CLAUSE_REDUCTION_CODE (clauses);
- OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_PLACEHOLDER (clauses);
- OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (c)
- = OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_SIMD];
- cclauses[C_OMP_CLAUSE_SPLIT_SIMD] = c;
- }
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- break;
- case OMP_CLAUSE_IF:
- if (OMP_CLAUSE_IF_MODIFIER (clauses) != ERROR_MARK)
- {
- s = C_OMP_CLAUSE_SPLIT_COUNT;
- switch (OMP_CLAUSE_IF_MODIFIER (clauses))
- {
- case OMP_PARALLEL:
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_THREADS)) != 0)
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- break;
- case OMP_SIMD:
- if (code == OMP_SIMD)
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- break;
- case OMP_TASKLOOP:
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))
- != 0)
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- break;
- case OMP_TARGET:
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP))
- != 0)
- s = C_OMP_CLAUSE_SPLIT_TARGET;
- break;
- default:
- break;
- }
- if (s != C_OMP_CLAUSE_SPLIT_COUNT)
- break;
- /* Error-recovery here, invalid if-modifier specified, add the
- clause to just one construct. */
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)) != 0)
- s = C_OMP_CLAUSE_SPLIT_TARGET;
- else if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_THREADS)) != 0)
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- else if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NOGROUP)) != 0)
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- else if (code == OMP_SIMD)
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- else
- gcc_unreachable ();
- break;
- }
- /* Otherwise, duplicate if clause to all constructs. */
- if (code == OMP_SIMD)
- {
- if ((mask & ((OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)
- | (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_THREADS)
- | (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP)))
- != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_IF);
- OMP_CLAUSE_IF_MODIFIER (c)
- = OMP_CLAUSE_IF_MODIFIER (clauses);
- OMP_CLAUSE_IF_EXPR (c) = OMP_CLAUSE_IF_EXPR (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_SIMD];
- cclauses[C_OMP_CLAUSE_SPLIT_SIMD] = c;
- }
- else
- {
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- break;
- }
- }
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))
- != 0)
- {
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_THREADS)) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_IF);
- OMP_CLAUSE_IF_MODIFIER (c)
- = OMP_CLAUSE_IF_MODIFIER (clauses);
- OMP_CLAUSE_IF_EXPR (c) = OMP_CLAUSE_IF_EXPR (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TASKLOOP];
- cclauses[C_OMP_CLAUSE_SPLIT_TASKLOOP] = c;
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- }
- else
- s = C_OMP_CLAUSE_SPLIT_TASKLOOP;
- }
- else if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_THREADS)) != 0)
- {
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_MAP)) != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_IF);
- OMP_CLAUSE_IF_MODIFIER (c)
- = OMP_CLAUSE_IF_MODIFIER (clauses);
- OMP_CLAUSE_IF_EXPR (c) = OMP_CLAUSE_IF_EXPR (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TARGET];
- cclauses[C_OMP_CLAUSE_SPLIT_TARGET] = c;
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- }
- else
- s = C_OMP_CLAUSE_SPLIT_PARALLEL;
- }
- else
- s = C_OMP_CLAUSE_SPLIT_TARGET;
- break;
- case OMP_CLAUSE_LINEAR:
- /* Linear clause is allowed on simd and for. Put it on the
- innermost construct. */
- if (code == OMP_SIMD)
- s = C_OMP_CLAUSE_SPLIT_SIMD;
- else
- s = C_OMP_CLAUSE_SPLIT_FOR;
- break;
- case OMP_CLAUSE_NOWAIT:
- /* Nowait clause is allowed on target, for and sections, but
- is not allowed on parallel for or parallel sections. Therefore,
- put it on target construct if present, because that can only
- be combined with parallel for{, simd} and not with for{, simd},
- otherwise to the worksharing construct. */
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP))
- != 0)
- s = C_OMP_CLAUSE_SPLIT_TARGET;
- else
- s = C_OMP_CLAUSE_SPLIT_FOR;
- break;
- /* thread_limit is allowed on target and teams. Distribute it
- to all. */
- case OMP_CLAUSE_THREAD_LIMIT:
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP))
- != 0)
- {
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS))
- != 0)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_THREAD_LIMIT);
- OMP_CLAUSE_THREAD_LIMIT_EXPR (c)
- = OMP_CLAUSE_THREAD_LIMIT_EXPR (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[C_OMP_CLAUSE_SPLIT_TARGET];
- cclauses[C_OMP_CLAUSE_SPLIT_TARGET] = c;
- }
- else
- {
- s = C_OMP_CLAUSE_SPLIT_TARGET;
- break;
- }
- }
- s = C_OMP_CLAUSE_SPLIT_TEAMS;
- break;
- /* Allocate clause is allowed on target, teams, distribute, parallel,
- for, sections and taskloop. Distribute it to all. */
- case OMP_CLAUSE_ALLOCATE:
- s = C_OMP_CLAUSE_SPLIT_COUNT;
- for (i = 0; i < C_OMP_CLAUSE_SPLIT_COUNT; i++)
- {
- switch (i)
- {
- case C_OMP_CLAUSE_SPLIT_TARGET:
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_MAP)) == 0)
- continue;
- break;
- case C_OMP_CLAUSE_SPLIT_TEAMS:
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_TEAMS)) == 0)
- continue;
- break;
- case C_OMP_CLAUSE_SPLIT_DISTRIBUTE:
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)) == 0)
- continue;
- break;
- case C_OMP_CLAUSE_SPLIT_PARALLEL:
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NUM_THREADS)) == 0)
- continue;
- break;
- case C_OMP_CLAUSE_SPLIT_FOR:
- STATIC_ASSERT (C_OMP_CLAUSE_SPLIT_SECTIONS
- == C_OMP_CLAUSE_SPLIT_FOR
- && (C_OMP_CLAUSE_SPLIT_TASKLOOP
- == C_OMP_CLAUSE_SPLIT_FOR)
- && (C_OMP_CLAUSE_SPLIT_LOOP
- == C_OMP_CLAUSE_SPLIT_FOR));
- if (code == OMP_SECTIONS)
- break;
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_SCHEDULE)) != 0)
- break;
- if ((mask & (OMP_CLAUSE_MASK_1
- << PRAGMA_OMP_CLAUSE_NOGROUP)) != 0)
- break;
- continue;
- case C_OMP_CLAUSE_SPLIT_SIMD:
- continue;
- default:
- gcc_unreachable ();
- }
- if (s != C_OMP_CLAUSE_SPLIT_COUNT)
- {
- c = build_omp_clause (OMP_CLAUSE_LOCATION (clauses),
- OMP_CLAUSE_ALLOCATE);
- OMP_CLAUSE_DECL (c)
- = OMP_CLAUSE_DECL (clauses);
- OMP_CLAUSE_ALLOCATE_ALLOCATOR (c)
- = OMP_CLAUSE_ALLOCATE_ALLOCATOR (clauses);
- OMP_CLAUSE_ALLOCATE_ALIGN (c)
- = OMP_CLAUSE_ALLOCATE_ALIGN (clauses);
- OMP_CLAUSE_CHAIN (c) = cclauses[s];
- cclauses[s] = c;
- has_dup_allocate = true;
- }
- s = (enum c_omp_clause_split) i;
- }
- gcc_assert (s != C_OMP_CLAUSE_SPLIT_COUNT);
- break;
- default:
- gcc_unreachable ();
- }
- OMP_CLAUSE_CHAIN (clauses) = cclauses[s];
- cclauses[s] = clauses;
- }
-
- if (has_dup_allocate)
- {
- bool need_prune = false;
- bitmap_obstack_initialize (NULL);
- for (i = 0; i < C_OMP_CLAUSE_SPLIT_SIMD - (code == OMP_LOOP); i++)
- if (cclauses[i])
- {
- bitmap_head allocate_head;
- bitmap_initialize (&allocate_head, &bitmap_default_obstack);
- for (c = cclauses[i]; c; c = OMP_CLAUSE_CHAIN (c))
- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ALLOCATE
- && DECL_P (OMP_CLAUSE_DECL (c)))
- bitmap_set_bit (&allocate_head,
- DECL_UID (OMP_CLAUSE_DECL (c)));
- for (c = cclauses[i]; c; c = OMP_CLAUSE_CHAIN (c))
- switch (OMP_CLAUSE_CODE (c))
- {
- case OMP_CLAUSE_REDUCTION:
- case OMP_CLAUSE_IN_REDUCTION:
- case OMP_CLAUSE_TASK_REDUCTION:
- if (TREE_CODE (OMP_CLAUSE_DECL (c)) == MEM_REF)
- {
- tree t = TREE_OPERAND (OMP_CLAUSE_DECL (c), 0);
- if (TREE_CODE (t) == POINTER_PLUS_EXPR)
- t = TREE_OPERAND (t, 0);
- if (TREE_CODE (t) == ADDR_EXPR
- || TREE_CODE (t) == INDIRECT_REF)
- t = TREE_OPERAND (t, 0);
- if (DECL_P (t))
- bitmap_clear_bit (&allocate_head, DECL_UID (t));
- break;
- }
- else if (TREE_CODE (OMP_CLAUSE_DECL (c)) == TREE_LIST)
- {
- tree t;
- for (t = OMP_CLAUSE_DECL (c);
- TREE_CODE (t) == TREE_LIST; t = TREE_CHAIN (t))
- ;
- if (DECL_P (t))
- bitmap_clear_bit (&allocate_head, DECL_UID (t));
- break;
- }
- /* FALLTHRU */
- case OMP_CLAUSE_PRIVATE:
- case OMP_CLAUSE_FIRSTPRIVATE:
- case OMP_CLAUSE_LASTPRIVATE:
- case OMP_CLAUSE_LINEAR:
- if (DECL_P (OMP_CLAUSE_DECL (c)))
- bitmap_clear_bit (&allocate_head,
- DECL_UID (OMP_CLAUSE_DECL (c)));
- break;
- default:
- break;
- }
- for (c = cclauses[i]; c; c = OMP_CLAUSE_CHAIN (c))
- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ALLOCATE
- && DECL_P (OMP_CLAUSE_DECL (c))
- && bitmap_bit_p (&allocate_head,
- DECL_UID (OMP_CLAUSE_DECL (c))))
- {
- /* Mark allocate clauses which don't have corresponding
- explicit data sharing clause. */
- OMP_CLAUSE_ALLOCATE_COMBINED (c) = 1;
- need_prune = true;
- }
- }
- bitmap_obstack_release (NULL);
- if (need_prune)
- {
- /* At least one allocate clause has been marked. Walk all the
- duplicated allocate clauses in sync. If it is marked in all
- constituent constructs, diagnose it as invalid and remove
- them. Otherwise, remove all marked inner clauses inside
- a construct that doesn't have them marked. Keep the outer
- marked ones, because some clause duplication is done only
- during gimplification. */
- tree *p[C_OMP_CLAUSE_SPLIT_COUNT];
- for (i = 0; i < C_OMP_CLAUSE_SPLIT_COUNT; i++)
- if (cclauses[i] == NULL_TREE
- || i == C_OMP_CLAUSE_SPLIT_SIMD
- || (i == C_OMP_CLAUSE_SPLIT_LOOP && code == OMP_LOOP))
- p[i] = NULL;
- else
- p[i] = &cclauses[i];
- do
- {
- int j = -1;
- tree seen = NULL_TREE;
- for (i = C_OMP_CLAUSE_SPLIT_COUNT - 1; i >= 0; i--)
- if (p[i])
- {
- while (*p[i]
- && OMP_CLAUSE_CODE (*p[i]) != OMP_CLAUSE_ALLOCATE)
- p[i] = &OMP_CLAUSE_CHAIN (*p[i]);
- if (*p[i] == NULL_TREE)
- {
- i = C_OMP_CLAUSE_SPLIT_COUNT;
- break;
- }
- if (!OMP_CLAUSE_ALLOCATE_COMBINED (*p[i]) && j == -1)
- j = i;
- seen = *p[i];
- }
- if (i == C_OMP_CLAUSE_SPLIT_COUNT)
- break;
- if (j == -1)
- error_at (OMP_CLAUSE_LOCATION (seen),
- "%qD specified in %<allocate%> clause but not in "
- "an explicit privatization clause",
- OMP_CLAUSE_DECL (seen));
- for (i = 0; i < C_OMP_CLAUSE_SPLIT_COUNT; i++)
- if (p[i])
- {
- if (i > j)
- /* Remove. */
- *p[i] = OMP_CLAUSE_CHAIN (*p[i]);
- else
- /* Keep. */
- p[i] = &OMP_CLAUSE_CHAIN (*p[i]);
- }
- }
- while (1);
- }
- }
-
- if (!flag_checking)
- return;
-
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_MAP)) == 0)
- gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_TARGET] == NULL_TREE);
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_TEAMS)) == 0)
- gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_TEAMS] == NULL_TREE);
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_DIST_SCHEDULE)) == 0
- && (mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_FILTER)) == 0)
- gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_DISTRIBUTE] == NULL_TREE);
- if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NUM_THREADS)) == 0)
- gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_PARALLEL] == NULL_TREE);
- if ((mask & ((OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)
- | (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_NOGROUP))) == 0
- && code != OMP_SECTIONS
- && code != OMP_LOOP)
- gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_FOR] == NULL_TREE);
- if (code != OMP_SIMD)
- gcc_assert (cclauses[C_OMP_CLAUSE_SPLIT_SIMD] == NULL_TREE);
-}
-
-
-/* qsort callback to compare #pragma omp declare simd clauses. */
-
-static int
-c_omp_declare_simd_clause_cmp (const void *p, const void *q)
-{
- tree a = *(const tree *) p;
- tree b = *(const tree *) q;
- if (OMP_CLAUSE_CODE (a) != OMP_CLAUSE_CODE (b))
- {
- if (OMP_CLAUSE_CODE (a) > OMP_CLAUSE_CODE (b))
- return -1;
- return 1;
- }
- if (OMP_CLAUSE_CODE (a) != OMP_CLAUSE_SIMDLEN
- && OMP_CLAUSE_CODE (a) != OMP_CLAUSE_INBRANCH
- && OMP_CLAUSE_CODE (a) != OMP_CLAUSE_NOTINBRANCH)
- {
- int c = tree_to_shwi (OMP_CLAUSE_DECL (a));
- int d = tree_to_shwi (OMP_CLAUSE_DECL (b));
- if (c < d)
- return 1;
- if (c > d)
- return -1;
- }
- return 0;
-}
-
-/* Change PARM_DECLs in OMP_CLAUSE_DECL of #pragma omp declare simd
- CLAUSES on FNDECL into argument indexes and sort them. */
-
-tree
-c_omp_declare_simd_clauses_to_numbers (tree parms, tree clauses)
-{
- tree c;
- vec<tree> clvec = vNULL;
-
- for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
- {
- if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_SIMDLEN
- && OMP_CLAUSE_CODE (c) != OMP_CLAUSE_INBRANCH
- && OMP_CLAUSE_CODE (c) != OMP_CLAUSE_NOTINBRANCH)
- {
- tree decl = OMP_CLAUSE_DECL (c);
- tree arg;
- int idx;
- for (arg = parms, idx = 0; arg;
- arg = TREE_CHAIN (arg), idx++)
- if (arg == decl)
- break;
- if (arg == NULL_TREE)
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "%qD is not a function argument", decl);
- continue;
- }
- OMP_CLAUSE_DECL (c) = build_int_cst (integer_type_node, idx);
- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR
- && OMP_CLAUSE_LINEAR_VARIABLE_STRIDE (c))
- {
- decl = OMP_CLAUSE_LINEAR_STEP (c);
- for (arg = parms, idx = 0; arg;
- arg = TREE_CHAIN (arg), idx++)
- if (arg == decl)
- break;
- if (arg == NULL_TREE)
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "%qD is not a function argument", decl);
- continue;
- }
- OMP_CLAUSE_LINEAR_STEP (c)
- = build_int_cst (integer_type_node, idx);
- }
- }
- clvec.safe_push (c);
- }
- if (!clvec.is_empty ())
- {
- unsigned int len = clvec.length (), i;
- clvec.qsort (c_omp_declare_simd_clause_cmp);
- clauses = clvec[0];
- for (i = 0; i < len; i++)
- OMP_CLAUSE_CHAIN (clvec[i]) = (i < len - 1) ? clvec[i + 1] : NULL_TREE;
- }
- else
- clauses = NULL_TREE;
- clvec.release ();
- return clauses;
-}
-
-/* Change argument indexes in CLAUSES of FNDECL back to PARM_DECLs. */
-
-void
-c_omp_declare_simd_clauses_to_decls (tree fndecl, tree clauses)
-{
- tree c;
-
- for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
- if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_SIMDLEN
- && OMP_CLAUSE_CODE (c) != OMP_CLAUSE_INBRANCH
- && OMP_CLAUSE_CODE (c) != OMP_CLAUSE_NOTINBRANCH)
- {
- int idx = tree_to_shwi (OMP_CLAUSE_DECL (c)), i;
- tree arg;
- for (arg = DECL_ARGUMENTS (fndecl), i = 0; arg;
- arg = TREE_CHAIN (arg), i++)
- if (i == idx)
- break;
- gcc_assert (arg);
- OMP_CLAUSE_DECL (c) = arg;
- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR
- && OMP_CLAUSE_LINEAR_VARIABLE_STRIDE (c))
- {
- idx = tree_to_shwi (OMP_CLAUSE_LINEAR_STEP (c));
- for (arg = DECL_ARGUMENTS (fndecl), i = 0; arg;
- arg = TREE_CHAIN (arg), i++)
- if (i == idx)
- break;
- gcc_assert (arg);
- OMP_CLAUSE_LINEAR_STEP (c) = arg;
- }
- }
-}
-
-/* Return true for __func__ and similar function-local predefined
- variables (which are in OpenMP predetermined shared, allowed in
- shared/firstprivate clauses). */
-
-bool
-c_omp_predefined_variable (tree decl)
-{
- if (VAR_P (decl)
- && DECL_ARTIFICIAL (decl)
- && TREE_STATIC (decl)
- && DECL_NAME (decl))
- {
- if (TREE_READONLY (decl)
- && (DECL_NAME (decl) == ridpointers[RID_C99_FUNCTION_NAME]
- || DECL_NAME (decl) == ridpointers[RID_FUNCTION_NAME]
- || DECL_NAME (decl) == ridpointers[RID_PRETTY_FUNCTION_NAME]))
- return true;
- /* For UBSan handle the same also ubsan_create_data created
- variables. There is no magic flag for those, but user variables
- shouldn't be DECL_ARTIFICIAL or have TYPE_ARTIFICIAL type with
- such names. */
- if ((flag_sanitize & (SANITIZE_UNDEFINED
- | SANITIZE_UNDEFINED_NONDEFAULT)) != 0
- && DECL_IGNORED_P (decl)
- && !TREE_READONLY (decl)
- && TREE_CODE (DECL_NAME (decl)) == IDENTIFIER_NODE
- && TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
- && TYPE_ARTIFICIAL (TREE_TYPE (decl))
- && TYPE_NAME (TREE_TYPE (decl))
- && TREE_CODE (TYPE_NAME (TREE_TYPE (decl))) == TYPE_DECL
- && DECL_NAME (TYPE_NAME (TREE_TYPE (decl)))
- && (TREE_CODE (DECL_NAME (TYPE_NAME (TREE_TYPE (decl))))
- == IDENTIFIER_NODE))
- {
- tree id1 = DECL_NAME (decl);
- tree id2 = DECL_NAME (TYPE_NAME (TREE_TYPE (decl)));
- if (IDENTIFIER_LENGTH (id1) >= sizeof ("ubsan_data") - 1
- && IDENTIFIER_LENGTH (id2) >= sizeof ("__ubsan__data")
- && !memcmp (IDENTIFIER_POINTER (id2), "__ubsan_",
- sizeof ("__ubsan_") - 1)
- && !memcmp (IDENTIFIER_POINTER (id2) + IDENTIFIER_LENGTH (id2)
- - sizeof ("_data") + 1, "_data",
- sizeof ("_data") - 1)
- && strstr (IDENTIFIER_POINTER (id1), "ubsan_data"))
- return true;
- }
- }
- return false;
-}
-
-/* OMP_CLAUSE_DEFAULT_UNSPECIFIED unless OpenMP sharing attribute of DECL
- is predetermined. */
-
-enum omp_clause_default_kind
-c_omp_predetermined_sharing (tree decl)
-{
- /* Predetermine artificial variables holding integral values, those
- are usually result of gimplify_one_sizepos or SAVE_EXPR
- gimplification. */
- if (VAR_P (decl)
- && DECL_ARTIFICIAL (decl)
- && INTEGRAL_TYPE_P (TREE_TYPE (decl)))
- return OMP_CLAUSE_DEFAULT_SHARED;
-
- if (c_omp_predefined_variable (decl))
- return OMP_CLAUSE_DEFAULT_SHARED;
-
- return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
-}
-
-/* OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED unless OpenMP mapping attribute
- of DECL is predetermined. */
-
-enum omp_clause_defaultmap_kind
-c_omp_predetermined_mapping (tree decl)
-{
- /* Predetermine artificial variables holding integral values, those
- are usually result of gimplify_one_sizepos or SAVE_EXPR
- gimplification. */
- if (VAR_P (decl)
- && DECL_ARTIFICIAL (decl)
- && INTEGRAL_TYPE_P (TREE_TYPE (decl)))
- return OMP_CLAUSE_DEFAULTMAP_FIRSTPRIVATE;
-
- if (c_omp_predefined_variable (decl))
- return OMP_CLAUSE_DEFAULTMAP_TO;
-
- return OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED;
-}
-
-
-/* For OpenACC, the OMP_CLAUSE_MAP_KIND of an OMP_CLAUSE_MAP is used internally
- to distinguish clauses as seen by the user. Return the "friendly" clause
- name for error messages etc., where possible. See also
- c/c-parser.c:c_parser_oacc_data_clause and
- cp/parser.c:cp_parser_oacc_data_clause. */
-
-const char *
-c_omp_map_clause_name (tree clause, bool oacc)
-{
- if (oacc && OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_MAP)
- switch (OMP_CLAUSE_MAP_KIND (clause))
- {
- case GOMP_MAP_FORCE_ALLOC:
- case GOMP_MAP_ALLOC: return "create";
- case GOMP_MAP_FORCE_TO:
- case GOMP_MAP_TO: return "copyin";
- case GOMP_MAP_FORCE_FROM:
- case GOMP_MAP_FROM: return "copyout";
- case GOMP_MAP_FORCE_TOFROM:
- case GOMP_MAP_TOFROM: return "copy";
- case GOMP_MAP_RELEASE: return "delete";
- case GOMP_MAP_FORCE_PRESENT: return "present";
- case GOMP_MAP_ATTACH: return "attach";
- case GOMP_MAP_FORCE_DETACH:
- case GOMP_MAP_DETACH: return "detach";
- case GOMP_MAP_DEVICE_RESIDENT: return "device_resident";
- case GOMP_MAP_LINK: return "link";
- case GOMP_MAP_FORCE_DEVICEPTR: return "deviceptr";
- default: break;
- }
- return omp_clause_code_name[OMP_CLAUSE_CODE (clause)];
-}
-
-/* Used to merge map clause information in c_omp_adjust_map_clauses. */
-struct map_clause
-{
- tree clause;
- bool firstprivate_ptr_p;
- bool decl_mapped;
- bool omp_declare_target;
- map_clause (void) : clause (NULL_TREE), firstprivate_ptr_p (false),
- decl_mapped (false), omp_declare_target (false) { }
-};
-
-/* Adjust map clauses after normal clause parsing, mainly to turn specific
- base-pointer map cases into attach/detach and mark them addressable. */
-void
-c_omp_adjust_map_clauses (tree clauses, bool is_target)
-{
- if (!is_target)
- {
- /* If this is not a target construct, just turn firstprivate pointers
- into attach/detach, the runtime will check and do the rest. */
-
- for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
- && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER
- && DECL_P (OMP_CLAUSE_DECL (c))
- && POINTER_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (c))))
- {
- tree ptr = OMP_CLAUSE_DECL (c);
- OMP_CLAUSE_SET_MAP_KIND (c, GOMP_MAP_ATTACH_DETACH);
- c_common_mark_addressable_vec (ptr);
- }
- return;
- }
-
- hash_map<tree, map_clause> maps;
-
- for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
- && DECL_P (OMP_CLAUSE_DECL (c)))
- {
- /* If this is for a target construct, the firstprivate pointer
- is changed to attach/detach if either is true:
- (1) the base-pointer is mapped in this same construct, or
- (2) the base-pointer is a variable place on the device by
- "declare target" directives.
-
- Here we iterate through all map clauses collecting these cases,
- and merge them with a hash_map to process below. */
-
- if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_POINTER
- && POINTER_TYPE_P (TREE_TYPE (OMP_CLAUSE_DECL (c))))
- {
- tree ptr = OMP_CLAUSE_DECL (c);
- map_clause &mc = maps.get_or_insert (ptr);
- if (mc.clause == NULL_TREE)
- mc.clause = c;
- mc.firstprivate_ptr_p = true;
-
- if (is_global_var (ptr)
- && lookup_attribute ("omp declare target",
- DECL_ATTRIBUTES (ptr)))
- mc.omp_declare_target = true;
- }
- else if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ALLOC
- || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_TO
- || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FROM
- || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_TOFROM
- || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ALWAYS_TO
- || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ALWAYS_FROM
- || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_ALWAYS_TOFROM)
- {
- map_clause &mc = maps.get_or_insert (OMP_CLAUSE_DECL (c));
- mc.decl_mapped = true;
- }
- }
-
- for (hash_map<tree, map_clause>::iterator i = maps.begin ();
- i != maps.end (); ++i)
- {
- map_clause &mc = (*i).second;
-
- if (mc.firstprivate_ptr_p
- && (mc.decl_mapped || mc.omp_declare_target))
- {
- OMP_CLAUSE_SET_MAP_KIND (mc.clause, GOMP_MAP_ATTACH_DETACH);
- c_common_mark_addressable_vec (OMP_CLAUSE_DECL (mc.clause));
- }
- }
-}
-
-static const struct c_omp_directive omp_directives[] = {
- /* Keep this alphabetically sorted by the first word. Non-null second/third
- if any should precede null ones. */
- { "allocate", nullptr, nullptr, PRAGMA_OMP_ALLOCATE,
- C_OMP_DIR_DECLARATIVE, false },
- /* { "assume", nullptr, nullptr, PRAGMA_OMP_ASSUME,
- C_OMP_DIR_INFORMATIONAL, false }, */
- /* { "assumes", nullptr, nullptr, PRAGMA_OMP_ASSUMES,
- C_OMP_DIR_INFORMATIONAL, false }, */
- { "atomic", nullptr, nullptr, PRAGMA_OMP_ATOMIC,
- C_OMP_DIR_CONSTRUCT, false },
- { "barrier", nullptr, nullptr, PRAGMA_OMP_BARRIER,
- C_OMP_DIR_STANDALONE, false },
- /* { "begin", "assumes", nullptr, PRAGMA_OMP_BEGIN,
- C_OMP_DIR_INFORMATIONAL, false }, */
- /* { "begin", "declare", "target", PRAGMA_OMP_BEGIN,
- C_OMP_DIR_DECLARATIVE, false }, */
- /* { "begin", "declare", "variant", PRAGMA_OMP_BEGIN,
- C_OMP_DIR_DECLARATIVE, false }, */
- /* { "begin", "metadirective", nullptr, PRAGMA_OMP_BEGIN,
- C_OMP_DIR_???, ??? }, */
- { "cancel", nullptr, nullptr, PRAGMA_OMP_CANCEL,
- C_OMP_DIR_STANDALONE, false },
- { "cancellation", "point", nullptr, PRAGMA_OMP_CANCELLATION_POINT,
- C_OMP_DIR_STANDALONE, false },
- { "critical", nullptr, nullptr, PRAGMA_OMP_CRITICAL,
- C_OMP_DIR_CONSTRUCT, false },
- /* { "declare", "mapper", nullptr, PRAGMA_OMP_DECLARE,
- C_OMP_DIR_DECLARATIVE, false }, */
- { "declare", "reduction", nullptr, PRAGMA_OMP_DECLARE,
- C_OMP_DIR_DECLARATIVE, true },
- { "declare", "simd", nullptr, PRAGMA_OMP_DECLARE,
- C_OMP_DIR_DECLARATIVE, true },
- { "declare", "target", nullptr, PRAGMA_OMP_DECLARE,
- C_OMP_DIR_DECLARATIVE, false },
- { "declare", "variant", nullptr, PRAGMA_OMP_DECLARE,
- C_OMP_DIR_DECLARATIVE, false },
- { "depobj", nullptr, nullptr, PRAGMA_OMP_DEPOBJ,
- C_OMP_DIR_STANDALONE, false },
- /* { "dispatch", nullptr, nullptr, PRAGMA_OMP_DISPATCH,
- C_OMP_DIR_CONSTRUCT, false }, */
- { "distribute", nullptr, nullptr, PRAGMA_OMP_DISTRIBUTE,
- C_OMP_DIR_CONSTRUCT, true },
- /* { "end", "assumes", nullptr, PRAGMA_OMP_END,
- C_OMP_DIR_INFORMATIONAL, false }, */
- { "end", "declare", "target", PRAGMA_OMP_END_DECLARE_TARGET,
- C_OMP_DIR_DECLARATIVE, false },
- /* { "end", "declare", "variant", PRAGMA_OMP_END,
- C_OMP_DIR_DECLARATIVE, false }, */
- /* { "end", "metadirective", nullptr, PRAGMA_OMP_END,
- C_OMP_DIR_???, ??? }, */
- /* error with at(execution) is C_OMP_DIR_STANDALONE. */
- { "error", nullptr, nullptr, PRAGMA_OMP_ERROR,
- C_OMP_DIR_UTILITY, false },
- { "flush", nullptr, nullptr, PRAGMA_OMP_FLUSH,
- C_OMP_DIR_STANDALONE, false },
- { "for", nullptr, nullptr, PRAGMA_OMP_FOR,
- C_OMP_DIR_CONSTRUCT, true },
- /* { "interop", nullptr, nullptr, PRAGMA_OMP_INTEROP,
- C_OMP_DIR_STANDALONE, false }, */
- { "loop", nullptr, nullptr, PRAGMA_OMP_LOOP,
- C_OMP_DIR_CONSTRUCT, true },
- { "masked", nullptr, nullptr, PRAGMA_OMP_MASKED,
- C_OMP_DIR_CONSTRUCT, true },
- { "master", nullptr, nullptr, PRAGMA_OMP_MASTER,
- C_OMP_DIR_CONSTRUCT, true },
- /* { "metadirective", nullptr, nullptr, PRAGMA_OMP_METADIRECTIVE,
- C_OMP_DIR_???, ??? }, */
- { "nothing", nullptr, nullptr, PRAGMA_OMP_NOTHING,
- C_OMP_DIR_UTILITY, false },
- /* ordered with depend clause is C_OMP_DIR_STANDALONE. */
- { "ordered", nullptr, nullptr, PRAGMA_OMP_ORDERED,
- C_OMP_DIR_CONSTRUCT, true },
- { "parallel", nullptr, nullptr, PRAGMA_OMP_PARALLEL,
- C_OMP_DIR_CONSTRUCT, true },
- { "requires", nullptr, nullptr, PRAGMA_OMP_REQUIRES,
- C_OMP_DIR_INFORMATIONAL, false },
- { "scan", nullptr, nullptr, PRAGMA_OMP_SCAN,
- C_OMP_DIR_CONSTRUCT, true },
- { "scope", nullptr, nullptr, PRAGMA_OMP_SCOPE,
- C_OMP_DIR_CONSTRUCT, false },
- { "section", nullptr, nullptr, PRAGMA_OMP_SECTION,
- C_OMP_DIR_CONSTRUCT, false },
- { "sections", nullptr, nullptr, PRAGMA_OMP_SECTIONS,
- C_OMP_DIR_CONSTRUCT, false },
- { "simd", nullptr, nullptr, PRAGMA_OMP_SIMD,
- C_OMP_DIR_CONSTRUCT, true },
- { "single", nullptr, nullptr, PRAGMA_OMP_SINGLE,
- C_OMP_DIR_CONSTRUCT, false },
- { "target", "data", nullptr, PRAGMA_OMP_TARGET,
- C_OMP_DIR_CONSTRUCT, false },
- { "target", "enter", "data", PRAGMA_OMP_TARGET,
- C_OMP_DIR_STANDALONE, false },
- { "target", "exit", "data", PRAGMA_OMP_TARGET,
- C_OMP_DIR_STANDALONE, false },
- { "target", "update", nullptr, PRAGMA_OMP_TARGET,
- C_OMP_DIR_STANDALONE, false },
- { "target", nullptr, nullptr, PRAGMA_OMP_TARGET,
- C_OMP_DIR_CONSTRUCT, true },
- { "task", nullptr, nullptr, PRAGMA_OMP_TASK,
- C_OMP_DIR_CONSTRUCT, false },
- { "taskgroup", nullptr, nullptr, PRAGMA_OMP_TASKGROUP,
- C_OMP_DIR_CONSTRUCT, false },
- { "taskloop", nullptr, nullptr, PRAGMA_OMP_TASKLOOP,
- C_OMP_DIR_CONSTRUCT, true },
- { "taskwait", nullptr, nullptr, PRAGMA_OMP_TASKWAIT,
- C_OMP_DIR_STANDALONE, false },
- { "taskyield", nullptr, nullptr, PRAGMA_OMP_TASKYIELD,
- C_OMP_DIR_STANDALONE, false },
- /* { "tile", nullptr, nullptr, PRAGMA_OMP_TILE,
- C_OMP_DIR_CONSTRUCT, false }, */
- { "teams", nullptr, nullptr, PRAGMA_OMP_TEAMS,
- C_OMP_DIR_CONSTRUCT, true },
- { "threadprivate", nullptr, nullptr, PRAGMA_OMP_THREADPRIVATE,
- C_OMP_DIR_DECLARATIVE, false }
- /* { "unroll", nullptr, nullptr, PRAGMA_OMP_UNROLL,
- C_OMP_DIR_CONSTRUCT, false }, */
-};
-
-/* Find (non-combined/composite) OpenMP directive (if any) which starts
- with FIRST keyword and for multi-word directives has SECOND and
- THIRD keyword after it. */
-
-const struct c_omp_directive *
-c_omp_categorize_directive (const char *first, const char *second,
- const char *third)
-{
- const size_t n_omp_directives = ARRAY_SIZE (omp_directives);
- for (size_t i = 0; i < n_omp_directives; i++)
- {
- if ((unsigned char) omp_directives[i].first[0]
- < (unsigned char) first[0])
- continue;
- if ((unsigned char) omp_directives[i].first[0]
- > (unsigned char) first[0])
- break;
- if (strcmp (omp_directives[i].first, first))
- continue;
- if (!omp_directives[i].second)
- return &omp_directives[i];
- if (!second || strcmp (omp_directives[i].second, second))
- continue;
- if (!omp_directives[i].third)
- return &omp_directives[i];
- if (!third || strcmp (omp_directives[i].third, third))
- continue;
- return &omp_directives[i];
- }
- return NULL;
-}