aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
AgeCommit message (Collapse)AuthorFilesLines
2022-01-17Rename .c files to .cc files.Martin Liska1-6180/+0
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.
2022-01-12c++: Silence -Wuseless-cast warnings during move [PR103480]Jakub Jelinek1-0/+2
This is maybe just a shot in the dark, but IMHO we shouldn't be diagnosing -Wuseless-cast on casts the compiler adds on its own when calling its move function. We don't seem to warn when user calls std::move either. We call move on elinit (*NON_LVALUE_EXPR <(struct C[2] &&) &D.2497->b>)[0] so it is already an xvalue_p and try to static_cast it to struct C &&. But we don't warn e.g. on std::move (std::move (whatever)). Fixed by not doing the static cast and just returning expr from move if expr is already an xvalue. 2022-01-11 Jakub Jelinek <jakub@redhat.com> Jason Merrill <jason@redhat.com> PR c++/103480 * tree.c (move): If expr is xvalue_p, just return expr without build_static_cast. * g++.dg/warn/Wuseless-cast2.C: New test.
2022-01-08c++: default mem-init of array [PR103946]Jason Merrill1-4/+1
In the patch for PR92385 I added asserts to see if we tried to make a vec_init of a vec_init, but didn't see any in regression testing. This testcase is one case, which seems reasonable: we create a VEC_INIT_EXPR for the aggregate initializer, and then again to express the actual initialization of the member. We already do similar collapsing of TARGET_EXPR. So let's just remove the asserts. PR c++/103946 gcc/cp/ChangeLog: * init.c (build_vec_init): Remove assert. * tree.c (build_vec_init_expr): Likewise. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi-array1.C: New test.
2022-01-06c++: EH and partially constructed aggr temp [PR66139]Jason Merrill1-7/+8
Now that PR94041 is fixed, I can return to addressing PR66139, missing cleanups for partially constructed aggregate temporaries. My previous approach of calling split_nonconstant_init in cp_gimplify_init_expr broke because gimplification is too late to be introducing destructor calls. So instead I now call it under cp_fold_function, just before cp_genericize; doing it from cp_genericize itself ran into trouble with the rewriting of invisible references. So now the prediction in cp_gimplify_expr that cp_gimplify_init_expr might need to replace references to TARGET_EXPR_SLOT within TARGET_EXPR_INITIAL has come to pass. constexpr.c already had the simple search-and-replace tree walk I needed, but it needed to be fixed to actually replace all occurrences instead of just the first one. Handling of VEC_INIT_EXPR at gimplify time had similar issues that we worked around with build_vec_init_elt, so I'm moving that to cp_fold_function as well. But it seems that build_vec_init_elt is still useful for setting the VEC_INIT_EXPR_IS_CONSTEXPR flag, so I'm leaving it alone. This also fixes 52320, because build_aggr_init of each X from build_vec_init builds an INIT_EXPR rather than call split_nonconstant_init at that point, and now that INIT_EXPR gets split later. PR c++/66139 PR c++/52320 gcc/cp/ChangeLog: * constexpr.c (replace_decl): Rename from replace_result_decl. * cp-tree.h (replace_decl): Declare it. * cp-gimplify.c (cp_gimplify_init_expr): Call it. (cp_gimplify_expr): Don't handle VEC_INIT_EXPR. (cp_genericize_init, cp_genericize_init_expr) (cp_genericize_target_expr): New. (cp_fold_r): Call them. * tree.c (build_array_copy): Add a TARGET_EXPR. * typeck2.c (digest_init_r): Look through a TARGET_EXPR. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/initlist116.C: New test. * g++.dg/cpp0x/initlist117.C: New test. * g++.dg/cpp0x/lambda/lambda-eh.C: New test. * g++.dg/eh/aggregate1.C: New test.
2022-01-06c++: temporary lifetime with array aggr init [PR94041]Jason Merrill1-2/+3
The previous patch fixed temporary lifetime for aggregate initialization of classes; this one extends that fix to arrays. This specifically reverses my r74790, the patch for PR12253, which was made wrong when these semantics were specified in DR201. Since the array cleanup region encloses the regions for any temporaries, we don't need to add an additional region for the array object itself in either initialize_local_var or split_nonconstant_init; we do, however, need to tell split_nonconstant_init how to disable the cleanup once an enclosing object is fully constructed, at which point we want to run that destructor instead. PR c++/94041 gcc/cp/ChangeLog: * decl.c (initialize_local_var): Fix comment. * init.c (build_new_1): Do stabilize array init. (build_vec_init): Use TARGET_EXPR for cleanup. Initialization of an element from an explicit initializer is not a full-expression. * tree.c (expand_vec_init_expr): Pass flags through. * typeck2.c (split_nonconstant_init_1): Handle VEC_INIT_EXPR. (split_nonconstant_init): Handle array cleanups. * cp-tree.h: Adjust. gcc/testsuite/ChangeLog: * g++.dg/init/array12.C: * g++.dg/init/aggr7-eh2.C: New test. * g++.dg/init/aggr7-eh3.C: New test.
2022-01-06c++: loop over array elts w/o explicit init [PR92385]Jason Merrill1-13/+31
The PR complains that initializing a large array with {} takes a long time to compile; this was because digest_init would turn {} into a long CONSTRUCTOR with an initializer for each element, instead of more sensibly generating a loop. The standard doesn't specify this implementation, but it does allow for it by specifying that a temporary created "when a default constructor is called to initialize an element of an array with no corresponding initializer" is destroyed "before the construction of the next array element, if any." rather than living until the end of the complete object initialization as usual. This change is also needed before the PR94041 fix extends the lifetime of temporaries from elements with explicit initializers. To implement this, I change digest_init so that in cases where initialization of trailing array elements isn't constant, we return a VEC_INIT_EXPR instead of a bare CONSTRUCTOR; when it is encountered later, we call build_vec_init to generate the actual initialization code. PR c++/92385 gcc/cp/ChangeLog: * typeck2.c (PICFLAG_VEC_INIT): New. (process_init_constructor_array): Set it. (process_init_constructor): Handle it. (split_nonconstant_init_1): Handle VEC_INIT_EXPR. * init.c (build_vec_init): Likewise. * cp-gimplify.c (cp_gimplify_expr): Factor out... * tree.c (expand_vec_init_expr): ...this function. (build_vec_init_elt): Handle BRACE_ENCLOSED_INITIALIZER_P. (build_vec_init_expr): Likewise. * constexpr.c (cxx_eval_vec_init): Likewise. (reduced_constant_expression_p): Check arrays before C++20. * cp-tree.h (expand_vec_init_expr): Declare. gcc/testsuite/ChangeLog: * g++.dg/init/array61.C: New test.
2022-01-03Update copyright years.Jakub Jelinek1-1/+1
2021-12-16c++: two-stage name lookup for overloaded operators [PR51577]Patrick Palka1-2/+0
In order to properly implement two-stage name lookup for dependent operator expressions, we need to remember the result of unqualified lookup of the operator at template definition time, and reuse that result rather than performing another unqualified lookup at instantiation time. Ideally we could just store the lookup in the expression directly, but as pointed out in r9-6405 this isn't really possible since we use the standard tree codes to represent most dependent operator expressions. We could perhaps create a new tree code to represent dependent operator expressions, with enough operands to store the lookup along with everything else, but that'd require a lot of careful work to make sure we handle this new tree code properly across the frontend. But currently type-dependent operator (and call) expressions are given an empty TREE_TYPE, which dependent_type_p treats as dependent, so this field is effectively unused except to signal that the expression is type-dependent. It'd be convenient if we could store the lookup there while preserving the dependent-ness of the expression. To that end, this patch creates a new kind of type, called DEPENDENT_OPERATOR_TYPE, which we give to dependent operator expressions and into which we can store the result of operator lookup at template definition time (DEPENDENT_OPERATOR_TYPE_SAVED_LOOKUPS). Since this type is always dependent (by definition), and since the frontend doesn't seem to care much about the exact type of a type-dependent expression, using this type in place of a NULL_TREE type seems to "just work"; only dependent_type_p and WILDCARD_TYPE_P need to be adjusted to return true for this new type. The rest of the patch mostly consists of adding the necessary plumbing to pass DEPENDENT_OPERATOR_TYPE_SAVED_LOOKUPS to add_operator_candidates, adjusting all callers of build_x_* appropriately, and removing the now unnecessary push_operator_bindings mechanism. In passing, this patch simplifies finish_constraint_binary_op to avoid using build_x_binary_op for building a binary constraint-expr; we don't need to consider operator overloads here, as the &&/|| inside a constraint effectively always has the built-in meaning (since atomic constraints must have bool type). This patch also makes FOLD_EXPR_OP yield a tree_code instead of a raw INTEGER_CST. Finally, this patch adds the XFAILed test operator-8.C which is about broken two-stage name lookup for rewritten non-dependent operator expressions, an existing bug that's otherwise only documented in build_new_op. PR c++/51577 PR c++/83035 PR c++/100465 gcc/cp/ChangeLog: * call.c (add_operator_candidates): Add lookups parameter. Use it to avoid performing a second unqualified lookup when instantiating a dependent operator expression. (build_new_op): Add lookups parameter and pass it appropriately. * constraint.cc (finish_constraint_binary_op): Use build_min_nt_loc instead of build_x_binary_op. * coroutines.cc (build_co_await): Adjust call to build_new_op. * cp-objcp-common.c (cp_common_init_ts): Mark DEPENDENT_OPERATOR_TYPE appropriately. * cp-tree.def (DEPENDENT_OPERATOR_TYPE): Define. * cp-tree.h (WILDCARD_TYPE_P): Accept DEPENDENT_OPERATOR_TYPE. (FOLD_EXPR_OP_RAW): New, renamed from ... (FOLD_EXPR_OP): ... this. Change this to return the tree_code directly. (DEPENDENT_OPERATOR_TYPE_SAVED_LOOKUPS): Define. (templated_operator_saved_lookups): Define. (build_new_op): Add lookups parameter. (build_dependent_operator_type): Declare. (build_x_indirect_ref): Add lookups parameter. (build_x_binary_op): Likewise. (build_x_unary_op): Likewise. (build_x_compound_expr): Likewise. (build_x_modify_expr): Likewise. * cxx-pretty-print.c (get_fold_operator): Adjust after FOLD_EXPR_OP change. * decl.c (start_preparsed_function): Don't call push_operator_bindings. * decl2.c (grok_array_decl): Adjust calls to build_new_op. * method.c (do_one_comp): Likewise. (build_comparison_op): Likewise. * module.cc (trees_out::type_node): Handle DEPENDENT_OPERATOR_TYPE. (trees_in::tree_node): Likewise. * name-lookup.c (lookup_name): Revert r11-2876 change. (op_unqualified_lookup): Remove. (maybe_save_operator_binding): Remove. (discard_operator_bindings): Remove. (push_operator_bindings): Remove. * name-lookup.h (maybe_save_operator_binding): Remove. (push_operator_bindings): Remove. (discard_operator_bindings): Remove. * parser.c (cp_parser_unary_expression): Adjust calls to build_x_*. (cp_parser_binary_expression): Likewise. (cp_parser_assignment_expression): Likewise. (cp_parser_expression): Likewise. (do_range_for_auto_deduction): Likewise. (cp_convert_range_for): Likewise. (cp_parser_perform_range_for_lookup): Likewise. (cp_parser_template_argument): Likewise. (cp_parser_omp_for_cond): Likewise. (cp_parser_omp_for_incr): Likewise. (cp_parser_omp_for_loop_init): Likewise. (cp_convert_omp_range_for): Likewise. (cp_finish_omp_range_for): Likewise. * pt.c (fold_expression): Adjust after FOLD_EXPR_OP change. Pass templated_operator_saved_lookups to build_x_*. (tsubst_omp_for_iterator): Adjust call to build_x_modify_expr. (tsubst_expr) <case COMPOUND_EXPR>: Pass templated_operator_saved_lookups to build_x_*. (tsubst_copy_and_build) <case INDIRECT_REF>: Likewise. <case tcc_unary>: Likewise. <case tcc_binary>: Likewise. <case MODOP_EXPR>: Likewise. <case COMPOUND_EXPR>: Likewise. (dependent_type_p_r): Return true for DEPENDENT_OPERATOR_TYPE. * ptree.c (cxx_print_type): Handle DEPENDENT_OPERATOR_TYPE. * semantics.c (finish_increment_expr): Adjust call to build_x_unary_op. (finish_unary_op_expr): Likewise. (handle_omp_for_class_iterator): Adjust calls to build_x_*. (finish_omp_cancel): Likewise. (finish_unary_fold_expr): Use build_dependent_operator_type. (finish_binary_fold_expr): Likewise. * tree.c (cp_free_lang_data): Don't call discard_operator_bindings. * typeck.c (rationalize_conditional_expr): Adjust call to build_x_binary_op. (op_unqualified_lookup): Define. (build_dependent_operator_type): Define. (build_x_indirect_ref): Add lookups parameter and use build_dependent_operator_type. (build_x_binary_op): Likewise. (build_x_array_ref): Likewise. (build_x_unary_op): Likewise. (build_x_compound_expr_from_list): Adjust call to build_x_compound_expr. (build_x_compound_expr_from_vec): Likewise. (build_x_compound_expr): Add lookups parameter and use build_dependent_operator_type. (cp_build_modify_expr): Adjust call to build_new_op. (build_x_modify_expr): Add lookups parameter and use build_dependent_operator_type. * typeck2.c (build_x_arrow): Adjust call to build_new_op. libcc1/ChangeLog: * libcp1plugin.cc (plugin_build_unary_expr): Adjust call to build_x_unary_op. (plugin_build_binary_expr): Adjust call to build_x_binary_op. gcc/testsuite/ChangeLog: * g++.dg/lookup/operator-3.C: Split out operator overload declarations into ... * g++.dg/lookup/operator-3-ops.h: ... here. * g++.dg/lookup/operator-3a.C: New test. * g++.dg/lookup/operator-4.C: New test. * g++.dg/lookup/operator-4a.C: New test. * g++.dg/lookup/operator-5.C: New test. * g++.dg/lookup/operator-5a.C: New test. * g++.dg/lookup/operator-6.C: New test. * g++.dg/lookup/operator-7.C: New test. * g++.dg/lookup/operator-8.C: New test.
2021-12-15c++: Fix warning word splitting [PR103713]Martin Liska1-2/+3
PR c++/103713 gcc/cp/ChangeLog: * tree.c (maybe_warn_parm_abi): Fix warning word splitting.
2021-12-14c++: remove COMPOUND_EXPR_OVERLOADED flagPatrick Palka1-5/+0
This flag is never set because non-dependent COMPOUND_EXPRs that resolve to an overload are expressed as a CALL_EXPR at template definition time (in build_x_compound_expr) ever since r6-5772. gcc/cp/ChangeLog: * cp-tree.h (COMPOUND_EXPR_OVERLOADED): Remove. * pt.c (build_non_dependent_expr): Don't inspect the flag. * tree.c (build_min_non_dep): Don't set the flag.
2021-12-04c++: Allow indeterminate unsigned char or std::byte in bit_cast - P1272R4Jakub Jelinek1-0/+12
P1272R4 has added to the std::byteswap new stuff to me quite unrelated clarification for std::bit_cast. The patch treats it as DR, applying to all languages. We no longer diagnose if padding bits are stored into unsigned char or std::byte result, fields or bitfields, instead arrange for that result, those fields or bitfields to get indeterminate value (empty CONSTRUCTOR with CONSTRUCTOR_NO_ZEROING or just leaving the member's initializer out and setting CONSTRUCTOR_NO_ZEROING on parent). We still have a bug that we don't diagnose in lots of places lvalue-to-rvalue conversions of indeterminate values or class objects with some indeterminate members. 2021-12-04 Jakub Jelinek <jakub@redhat.com> * cp-tree.h (is_byte_access_type_not_plain_char): Declare. * tree.c (is_byte_access_type_not_plain_char): New function. * constexpr.c (clear_uchar_or_std_byte_in_mask): New function. (cxx_eval_bit_cast): Don't error about padding bits if target type is unsigned char or std::byte, instead return no clearing ctor. Use clear_uchar_or_std_byte_in_mask. * g++.dg/cpp2a/bit-cast11.C: New test. * g++.dg/cpp2a/bit-cast12.C: New test. * g++.dg/cpp2a/bit-cast13.C: New test. * g++.dg/cpp2a/bit-cast14.C: New test.
2021-11-26c++: Fix up taking address of an immediate function diagnostics [PR102753]Jakub Jelinek1-0/+3
On Wed, Oct 20, 2021 at 07:16:44PM -0400, Jason Merrill wrote: > or an unevaluated operand, or a subexpression of an immediate invocation. > > Hmm...that suggests that in consteval23.C, bar(foo) should also be OK, The following patch handles that by removing the diagnostics about taking address of immediate function from cp_build_addr_expr_1, and instead diagnoses it in cp_fold_r. To do that with proper locations, the patch attempts to ensure that ADDR_EXPRs of immediate functions get EXPR_LOCATION set and adds a PTRMEM_CST_LOCATION for PTRMEM_CSTs. Also, evaluation of std::source_location::current() is moved from genericization to cp_fold. 2021-11-26 Jakub Jelinek <jakub@redhat.com> PR c++/102753 * cp-tree.h (struct ptrmem_cst): Add locus member. (PTRMEM_CST_LOCATION): Define. * tree.c (make_ptrmem_cst): Set PTRMEM_CST_LOCATION to input_location. (cp_expr_location): Return PTRMEM_CST_LOCATION for PTRMEM_CST. * typeck.c (build_x_unary_op): Overwrite PTRMEM_CST_LOCATION for PTRMEM_CST instead of calling maybe_wrap_with_location. (cp_build_addr_expr_1): Don't diagnose taking address of immediate functions here. Instead when taking their address make sure the returned ADDR_EXPR has EXPR_LOCATION set. (expand_ptrmemfunc_cst): Copy over PTRMEM_CST_LOCATION to ADDR_EXPR's EXPR_LOCATION. (convert_for_assignment): Use cp_expr_loc_or_input_loc instead of EXPR_LOC_OR_LOC. * pt.c (tsubst_copy): Use build1_loc instead of build1. Ensure ADDR_EXPR of immediate function has EXPR_LOCATION set. * cp-gimplify.c (cp_fold_r): Diagnose taking address of immediate functions here. For consteval if don't walk THEN_CLAUSE. (cp_genericize_r): Move evaluation of calls to std::source_location::current from here to... (cp_fold): ... here. Don't assert calls to immediate functions must be source_location_current_p, instead only constant evaluate calls to source_location_current_p. * g++.dg/cpp2a/consteval20.C: Add some extra tests. * g++.dg/cpp2a/consteval23.C: Likewise. * g++.dg/cpp2a/consteval25.C: New test. * g++.dg/cpp2a/srcloc20.C: New test.
2021-11-25c++: Implement C++23 P2128R6 - Multidimensional subscript operator [PR102611]Jakub Jelinek1-1/+30
The following patch implements the C++23 Multidimensional subscript operator P2128R6 paper. As C++20 and older only allow a single expression in between []s (albeit for C++20 with a deprecation warning if it is a comma expression) and even in C++23 and for the coming years I think the vast majority of subscript expressions will still have a single expression and even in C++23 it is quite special, as e.g. the builtin operator requires exactly one assignment expression, the patch attempts to optimize for that case and if possible not to slow down that common case (or use more memory for it). So, already during parsing it differentiates between that (uses a single index_exp tree in that case) and the new cases (zero or two+ expressions in the list), for which it sets index_exp to NULL_TREE and uses a releasing_vec instead similarly to how e.g. finish_call_expr uses it. In call.c it introduces new functions build_op_subscript{,_1} which are something in between build_new_op{,_1} and build_op_call{,_1}. The former requires fixed number of arguments (and the patch still uses it for the common case of subscript with exactly one index expression), the latter handles variable number of arguments but is too CALL_EXPR specific and handles various cases that are unnecessary for the subscript. Right now the subscript for 0 or 2+ expressions doesn't need to deal with builtin candidates and so is quite simple. As discussed in the paper, for backwards compatibility, if for 2+ index expressions build_op_subscript fails (called with tf_none) and the expressions together form a valid comma expression (again checked with tf_none), it is used that C++20-ish way with a pedwarn about it, but if even that fails, build_op_subscript is called again with standard complain flags to diagnose it in the new way. And similarly for the builtin case. The -Wcomma-subscript warning used to be enabled by default unless -Wno-deprecated. Since the C/C++98..20 behavior is no longer deprecated, but ill-formed or changed meaning, it is now for C++23 enabled by default regardless of -Wno-deprecated and controls the pedwarn (but not the errors emitted if something wasn't valid before and isn't valid in C++23 either). 2021-11-25 Jakub Jelinek <jakub@redhat.com> PR c++/102611 gcc/ * doc/invoke.texi (-Wcomma-subscript): Document that for -std=c++20 the option isn't enabled by default with -Wno-deprecated but for -std=c++23 it is. gcc/c-family/ * c-opts.c (c_common_post_options): Enable -Wcomma-subscript by default for C++23 regardless of warn_deprecated. * c-cppbuiltin.c (c_cpp_builtins): Predefine __cpp_multidimensional_subscript=202110L for C++23. gcc/cp/ * cp-tree.h (build_op_subscript): Implement P2128R6 - Multidimensional subscript operator. Declare. (class releasing_vec): Add release method. (grok_array_decl): Remove bool argument, add vec<tree, va_gc> ** and tsubst_flags_t arguments. (build_min_non_dep_op_overload): Declare another overload. * parser.c (cp_parser_parenthesized_expression_list_elt): New function. (cp_parser_postfix_open_square_expression): Mention C++23 syntax in function comment. For C++23 parse zero or more than one initializer clauses in expression list, adjust grok_array_decl caller. (cp_parser_parenthesized_expression_list): Use cp_parser_parenthesized_expression_list_elt. (cp_parser_builtin_offsetof): Adjust grok_array_decl caller. * decl.c (grok_op_properties): For C++23 don't check number of arguments of operator[]. * decl2.c (grok_array_decl): Remove decltype_p argument, add index_exp_list and complain arguments. If index_exp is NULL, handle *index_exp_list as the subscript expression list. * tree.c (build_min_non_dep_op_overload): New overload. * call.c (add_operator_candidates, build_over_call): Adjust comments for removal of build_new_op_1. (build_op_subscript): New function. * pt.c (tsubst_copy_and_build_call_args): New function. (tsubst_copy_and_build) <case ARRAY_REF>: If second operand is magic CALL_EXPR with ovl_op_identifier (ARRAY_REF) as CALL_EXPR_FN, tsubst CALL_EXPR arguments including expanding pack expressions in it and call grok_array_decl instead of build_x_array_ref. <case CALL_EXPR>: Use tsubst_copy_and_build_call_args. * semantics.c (handle_omp_array_sections_1): Adjust grok_array_decl caller. gcc/testsuite/ * g++.dg/cpp2a/comma1.C: Expect different diagnostics for C++23. * g++.dg/cpp2a/comma3.C: Likewise. * g++.dg/cpp2a/comma4.C: Expect diagnostics for C++23. * g++.dg/cpp2a/comma5.C: Expect different diagnostics for C++23. * g++.dg/cpp23/feat-cxx2b.C: Test __cpp_multidimensional_subscript predefined macro. * g++.dg/cpp23/subscript1.C: New test. * g++.dg/cpp23/subscript2.C: New test. * g++.dg/cpp23/subscript3.C: New test. * g++.dg/cpp23/subscript4.C: New test. * g++.dg/cpp23/subscript5.C: New test. * g++.dg/cpp23/subscript6.C: New test.
2021-11-19c++: cp_walk_subtrees simplification for *_CAST_EXPRPatrick Palka1-7/+0
Let walk_tree_1 do the operand walking for us. gcc/cp/ChangeLog: * tree.c (cp_walk_subtrees) <case *_CAST_EXPR>: Don't explicitly walk the operands.
2021-10-05c++: Fix apply_identity_attributes [PR102548]Jakub Jelinek1-2/+2
The following testcase ICEs on x86_64-linux with -m32 due to a bug in apply_identity_attributes. The function is being smart and attempts not to duplicate the chain unnecessarily, if either there are no attributes that affect type identity or there is possibly empty set of attributes that do not affect type identity in the chain followed by attributes that do affect type identity, it reuses that attribute chain. The function mishandles the cases where in the chain an attribute affects type identity and is followed by one or more attributes that don't affect type identity (and then perhaps some further ones that do). There are two bugs. One is that when we notice first attribute that doesn't affect type identity after first attribute that does affect type identity (with perhaps some further such attributes in the chain after it), we want to put into the new chain just attributes starting from (inclusive) first_ident and up to (exclusive) the current attribute a, but the code puts into the chain all attributes starting with first_ident, including the ones that do not affect type identity and if e.g. we have doesn't0 affects1 doesn't2 affects3 affects4 sequence of attributes, the resulting sequence would have affects1 doesn't2 affects3 affects4 affects3 affects4 attributes, i.e. one attribute that shouldn't be there and two attributes duplicated. That is fixed by the a2 -> a2 != a change. The second one is that we ICE once we see second attribute that doesn't affect type identity after an attribute that affects it. That is because first_ident is set to error_mark_node after handling the first attribute that doesn't affect type identity (i.e. after we've copied the [first_ident, a) set of attributes to the new chain) to denote that from that time on, each attribute that affects type identity should be copied whenever it is seen (the if (as && as->affects_type_identity) code does that correctly). But that condition is false and first_ident is error_mark_node, we enter else if (first_ident) and use TREE_PURPOSE /TREE_VALUE/TREE_CHAIN on error_mark_node, which ICEs. When first_ident is error_mark_node and a doesn't affect type identity, we want to do nothing. So that is the && first_ident != error_mark_node chunk. 2021-10-05 Jakub Jelinek <jakub@redhat.com> PR c++/102548 * tree.c (apply_identity_attributes): Fix handling of the case where an attribute in the list doesn't affect type identity but some attribute before it does. * g++.target/i386/pr102548.C: New test.
2021-10-01c++: cv-qualified ref introduced by typedef [PR101783]qingzhe huang1-1/+8
The root cause of this bug is that it considers reference with cv-qualifiers as an error by generating value for variable "bad_quals". However, this is not correct for case of typedef. Here I quote spec [dcl.ref]/1 : "Cv-qualified references are ill-formed except when the cv-qualifiers are introduced through the use of a typedef-name ([dcl.typedef], [temp.param]) or decltype-specifier ([dcl.type.decltype]), in which case the cv-qualifiers are ignored." 2021-09-30 qingzhe huang <nickhuang99@hotmail.com> gcc/cp/ChangeLog: PR c++/101783 * tree.c (cp_build_qualified_type_real): Exclude typedef from error. gcc/testsuite/ChangeLog: PR c++/101783 * g++.dg/parse/pr101783.C: New test.
2021-08-17c++: Implement P0466R5 __cpp_lib_is_layout_compatible compiler helpers ↵Jakub Jelinek1-0/+1
[PR101539] The following patch implements __is_layout_compatible trait and __builtin_is_corresponding_member helper function for the std::is_corresponding_member template function. As the current definition of layout compatible type has various problems, which result e.g. in corresponding members in layout compatible types having different member offsets, the patch anticipates some changes to the C++ standard: 1) class or enumeral types aren't layout compatible if they have different alignment or size 2) if two members have different offsets, they can't be corresponding members ([[no_unique_address]] with empty types can change that, or alignas on the member decls) 3) in unions, bitfields can't correspond to non-unions, or bitfields can't correspond to bitfields with different widths, or members with [[no_unique_address]] can't correspond to members without that attribute __builtin_is_corresponding_member for anonymous structs (GCC extension) will recurse into the anonymous structs. For anonymous unions it will emit a sorry if it can't prove such member types can't appear in the anonymous unions or anonymous aggregates in that union, because corresponding member is defined only using common initial sequence which is only defined for std-layout non-union class types and so I have no idea what to do otherwise in that case. 2021-08-17 Jakub Jelinek <jakub@redhat.com> PR c++/101539 gcc/c-family/ * c-common.h (enum rid): Add RID_IS_LAYOUT_COMPATIBLE. * c-common.c (c_common_reswords): Add __is_layout_compatible. gcc/cp/ * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_LAYOUT_COMPATIBLE. (enum cp_built_in_function): Add CP_BUILT_IN_IS_CORRESPONDING_MEMBER. (fold_builtin_is_corresponding_member, next_common_initial_seqence, layout_compatible_type_p): Declare. * parser.c (cp_parser_primary_expression): Handle RID_IS_LAYOUT_COMPATIBLE. (cp_parser_trait_expr): Likewise. * cp-objcp-common.c (names_builtin_p): Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_LAYOUT_COMPATIBLE. * decl.c (cxx_init_decl_processing): Register __builtin_is_corresponding_member builtin. * constexpr.c (cxx_eval_builtin_function_call): Handle CP_BUILT_IN_IS_CORRESPONDING_MEMBER builtin. * semantics.c (is_corresponding_member_union, is_corresponding_member_aggr, fold_builtin_is_corresponding_member): New functions. (trait_expr_value): Handle CPTK_IS_LAYOUT_COMPATIBLE. (finish_trait_expr): Likewise. * typeck.c (next_common_initial_seqence, layout_compatible_type_p): New functions. * cp-gimplify.c (cp_gimplify_expr): Fold CP_BUILT_IN_IS_CORRESPONDING_MEMBER. (cp_fold): Likewise. * tree.c (builtin_valid_in_constant_expr_p): Handle CP_BUILT_IN_IS_CORRESPONDING_MEMBER. * cxx-pretty-print.c (pp_cxx_trait_expression): Handle CPTK_IS_LAYOUT_COMPATIBLE. * class.c (remove_zero_width_bit_fields): Remove. (layout_class_type): Don't call it. gcc/testsuite/ * g++.dg/cpp2a/is-corresponding-member1.C: New test. * g++.dg/cpp2a/is-corresponding-member2.C: New test. * g++.dg/cpp2a/is-corresponding-member3.C: New test. * g++.dg/cpp2a/is-corresponding-member4.C: New test. * g++.dg/cpp2a/is-corresponding-member5.C: New test. * g++.dg/cpp2a/is-corresponding-member6.C: New test. * g++.dg/cpp2a/is-corresponding-member7.C: New test. * g++.dg/cpp2a/is-corresponding-member8.C: New test. * g++.dg/cpp2a/is-layout-compatible1.C: New test. * g++.dg/cpp2a/is-layout-compatible2.C: New test. * g++.dg/cpp2a/is-layout-compatible3.C: New test.
2021-08-11c++: parameterized requires-expr as default argument [PR101725]Patrick Palka1-1/+3
Here we're rejecting the default template argument requires (T t) { x(t); } because we consider the 't' in the requirement to be a local variable (according to local_variable_p), and we generally forbid local variables from appearing inside default arguments. We can perhaps fix this by giving special treatment to parameters introduced by requires-expressions, but DR 2082 relaxed the restriction about local variables appearing within default arguments to permit them inside unevaluated operands thereof. So this patch just implements DR 2082 which also fixes this PR since a requires-expression is an unevaluated context. PR c++/101725 DR 2082 gcc/cp/ChangeLog: * cp-tree.h (unevaluated_p): Return true for REQUIRES_EXPR. * decl.c (local_variable_p_walkfn): Don't walk into unevaluated operands. * parser.c (cp_parser_primary_expression) <case CPP_NAME>: Never reject uses of local variables in unevaluated contexts. * tree.c (cp_walk_subtrees) <case REQUIRES_EXPR>: Increment cp_unevaluated_operand. Use cp_walk_tree directly instead of WALK_SUBTREE to avoid the goto. Use REQUIRES_EXPR_REQS instead of TREE_OPERAND directly. gcc/testsuite/ChangeLog: * g++.dg/DRs/dr2082.C: New test. * g++.dg/cpp2a/concepts-uneval4.C: New test.
2021-07-30c++: Implement P0466R5 __cpp_lib_is_pointer_interconvertible compiler ↵Jakub Jelinek1-5/+10
helpers [PR101539] The following patch attempts to implement the compiler helpers for libstdc++ std::is_pointer_interconvertible_base_of trait and std::is_pointer_interconvertible_with_class template function. For the former __is_pointer_interconvertible_base_of trait that checks first whether base and derived aren't non-union class types that are the same ignoring toplevel cv-qualifiers, otherwise if derived is unambiguously derived from base without cv-qualifiers, derived being a complete type, and if so, my limited understanding of any derived object being pointer-interconvertible with base subobject IMHO implies (because one can't inherit from unions or unions can't inherit) that we check if derived is standard layout type and we walk bases of derived recursively, stopping on a class that has any non-static data members and check if any of the bases is base. On class with non-static data members no bases are compared already. Upon discussions, this is something that maybe should have been changed in the standard with CWG 2254 and the patch no longer performs this and assumes all base subobjects of standard-layout class types are pointer-interconvertible with the whole class objects. The latter is implemented using a FE __builtin_is_pointer_interconvertible_with_class, but because on the library side it will be a template function, the builtin takes ... arguments and only during folding verifies it has a single argument with pointer to member type. The initial errors IMHO can only happen if one uses the builtin incorrectly by hand, the template function should ensure that it has exactly a single argument that has pointer to member type. Otherwise, again with my limited understanding of what the template function should do and pointer-interconvertibility, it folds to false for pointer-to-member-function, errors if basetype of the OFFSET_TYPE is incomplete, folds to false for non-std-layout non-union basetype, then finds the first non-static data member in the basetype or its bases (by ignoring DECL_FIELD_IS_BASE FIELD_DECLs that are empty, recursing into DECL_FIELD_IS_BASE FIELD_DECLs type that are non-empty (I think std layout should ensure there is at most one), for unions checks if membertype is same type as any of the union FIELD_DECLs, for non-unions the first other FIELD_DECL only, and for anonymous aggregates similarly (union vs. non-union) but recurses into the anon aggr types with std layout check for anon structures. If membertype doesn't match the type of first non-static data member (or for unions any of the members), then the builtin folds to false, otherwise the built folds to a check whether the argument is equal to OFFSET_TYPE of 0 or not, either at compile time if it is constant (e.g. for constexpr folding) or at runtime otherwise. As I wrote in the PR, I've tried my testcases with MSVC on godbolt that claims to implement it, and https://godbolt.org/z/3PnjM33vM for the first testcase shows it disagrees with my expectations on static_assert (std::is_pointer_interconvertible_base_of_v<D, F>); static_assert (std::is_pointer_interconvertible_base_of_v<E, F>); static_assert (!std::is_pointer_interconvertible_base_of_v<D, G>); static_assert (!std::is_pointer_interconvertible_base_of_v<D, I>); static_assert (std::is_pointer_interconvertible_base_of_v<H, volatile I>); Is that a bug in my patch or is MSVC buggy on these (or mix thereof)? https://godbolt.org/z/aYeYnne9d shows the second testcase, here it differs on: static_assert (std::is_pointer_interconvertible_with_class<F, int> (&F::b)); static_assert (std::is_pointer_interconvertible_with_class<I, int> (&I::g)); static_assert (std::is_pointer_interconvertible_with_class<L, int> (&L::b)); static_assert (std::is_pointer_interconvertible_with_class (&V::a)); static_assert (std::is_pointer_interconvertible_with_class (&V::b)); Again, my bug, MSVC bug, mix thereof? According to Jason the <D, G>, <D, I> case are the subject of the CWG 2254 above discussed change and the rest are likely MSVC bugs. Oh, and there is another thing, the standard has an example: struct A { int a; }; // a standard-layout class struct B { int b; }; // a standard-layout class struct C: public A, public B { }; // not a standard-layout class static_assert( is_pointer_interconvertible_with_class( &C::b ) ); // Succeeds because, despite its appearance, &C::b has type // “pointer to member of B of type int”. static_assert( is_pointer_interconvertible_with_class<C>( &C::b ) ); // Forces the use of class C, and fails. It seems to work as written with MSVC (second assertion fails), but fails with GCC with the patch: /tmp/1.C:22:57: error: no matching function for call to ‘is_pointer_interconvertible_with_class<C>(int B::*)’ 22 | static_assert( is_pointer_interconvertible_with_class<C>( &C::b ) ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ /tmp/1.C:8:1: note: candidate: ‘template<class S, class M> constexpr bool std::is_pointer_interconvertible_with_class(M S::*)’ 8 | is_pointer_interconvertible_with_class (M S::*m) noexcept | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/1.C:8:1: note: template argument deduction/substitution failed: /tmp/1.C:22:57: note: mismatched types ‘C’ and ‘B’ 22 | static_assert( is_pointer_interconvertible_with_class<C>( &C::b ) ); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ the second int argument isn't deduced. This boils down to: template <class S, class M> bool foo (M S::*m) noexcept; struct A { int a; }; struct B { int b; }; struct C : public A, public B {}; bool a = foo (&C::b); bool b = foo<C, int> (&C::b); bool c = foo<C> (&C::b); which with /std:c++20 or -std=c++20 is accepted by latest MSVC and ICC but rejected by GCC and clang (in both cases on the last line). Is this a GCC/clang bug in argument deduction (in that case I think we want a separate PR), or a bug in ICC/MSVC and the standard itself that should specify in the examples both template arguments instead of just the first? And this has been raised with the CWG. 2021-07-30 Jakub Jelinek <jakub@redhat.com> PR c++/101539 gcc/c-family/ * c-common.h (enum rid): Add RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF. * c-common.c (c_common_reswords): Add __is_pointer_interconvertible_base_of. gcc/cp/ * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF. (enum cp_built_in_function): Add CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. (fold_builtin_is_pointer_inverconvertible_with_class): Declare. * parser.c (cp_parser_primary_expression): Handle RID_IS_POINTER_INTERCONVERTIBLE_BASE_OF. (cp_parser_trait_expr): Likewise. * cp-objcp-common.c (names_builtin_p): Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF. * decl.c (cxx_init_decl_processing): Register __builtin_is_pointer_interconvertible_with_class builtin. * constexpr.c (cxx_eval_builtin_function_call): Handle CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS builtin. * semantics.c (pointer_interconvertible_base_of_p, first_nonstatic_data_member_p, fold_builtin_is_pointer_inverconvertible_with_class): New functions. (trait_expr_value): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF. (finish_trait_expr): Likewise. Formatting fix. * cp-gimplify.c (cp_gimplify_expr): Fold CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call fndecl_built_in_p just once. (cp_fold): Likewise. * tree.c (builtin_valid_in_constant_expr_p): Handle CP_BUILT_IN_IS_POINTER_INTERCONVERTIBLE_WITH_CLASS. Call fndecl_built_in_p just once. * cxx-pretty-print.c (pp_cxx_trait_expression): Handle CPTK_IS_POINTER_INTERCONVERTIBLE_BASE_OF. gcc/testsuite/ * g++.dg/cpp2a/is-pointer-interconvertible-base-of1.C: New test. * g++.dg/cpp2a/is-pointer-interconvertible-with-class1.C: New test. * g++.dg/cpp2a/is-pointer-interconvertible-with-class2.C: New test. * g++.dg/cpp2a/is-pointer-interconvertible-with-class3.C: New test. * g++.dg/cpp2a/is-pointer-interconvertible-with-class4.C: New test. * g++.dg/cpp2a/is-pointer-interconvertible-with-class5.C: New test. * g++.dg/cpp2a/is-pointer-interconvertible-with-class6.C: New test.
2021-06-24cp: add support for per-location warning groups.Martin Sebor1-1/+1
gcc/cp/ChangeLog: * call.c (build_over_call): Replace direct uses of TREE_NO_WARNING with warning_suppressed_p, suppress_warning, and copy_no_warning, or nothing if not necessary. (set_up_extended_ref_temp): Same. * class.c (layout_class_type): Same. * constraint.cc (constraint_satisfaction_value): Same. * coroutines.cc (finish_co_await_expr): Same. (finish_co_yield_expr): Same. (finish_co_return_stmt): Same. (build_actor_fn): Same. (coro_rewrite_function_body): Same. (morph_fn_to_coro): Same. * cp-gimplify.c (genericize_eh_spec_block): Same. (gimplify_expr_stmt): Same. (cp_genericize_r): Same. (cp_fold): Same. * cp-ubsan.c (cp_ubsan_instrument_vptr): Same. * cvt.c (cp_fold_convert): Same. (convert_to_void): Same. * decl.c (wrapup_namespace_globals): Same. (grokdeclarator): Same. (finish_function): Same. (require_deduced_type): Same. * decl2.c (no_linkage_error): Same. (c_parse_final_cleanups): Same. * except.c (expand_end_catch_block): Same. * init.c (build_new_1): Same. (build_new): Same. (build_vec_delete_1): Same. (build_vec_init): Same. (build_delete): Same. * method.c (defaultable_fn_check): Same. * parser.c (cp_parser_fold_expression): Same. (cp_parser_primary_expression): Same. * pt.c (push_tinst_level_loc): Same. (tsubst_copy): Same. (tsubst_omp_udr): Same. (tsubst_copy_and_build): Same. * rtti.c (build_if_nonnull): Same. * semantics.c (maybe_convert_cond): Same. (finish_return_stmt): Same. (finish_parenthesized_expr): Same. (cp_check_omp_declare_reduction): Same. * tree.c (build_cplus_array_type): Same. * typeck.c (build_ptrmemfunc_access_expr): Same. (cp_build_indirect_ref_1): Same. (cp_build_function_call_vec): Same. (warn_for_null_address): Same. (cp_build_binary_op): Same. (unary_complex_lvalue): Same. (cp_build_modify_expr): Same. (build_x_modify_expr): Same. (convert_for_assignment): Same.
2021-06-21c++: conversion to base of vbase in NSDMI [PR80431]Patrick Palka1-9/+5
The delayed processing of conversions to a virtual base in an NSDMI assumes the target base type is a (possibly indirect) virtual base of the current class, but the target base type could also be a base of a virtual base, as in the testcase below. Since such a base isn't a part of CLASSTYPE_VBASECLASSES, we end up miscompiling the testcase due to the call to build_base_path (with binfo=NULL_TREE) silently returning error_mark_node. Fix this by using convert_to_base to build the conversion instead. PR c++/80431 gcc/cp/ChangeLog: * tree.c (bot_replace): Use convert_to_base to build the conversion to the (morally) virtual base. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/nsdmi-virtual1a.C: New test.
2021-05-27c++: parameter pack inside static_assert [PR99893]Patrick Palka1-0/+5
Here, we're not finding the parameter pack inside the static_assert because STATIC_ASSERT trees are tcc_exceptional, and we weren't explicitly walking them in cp_walk_subtrees. PR c++/99893 gcc/cp/ChangeLog: * tree.c (cp_walk_subtrees) <case STATIC_ASSERT>: New case. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/static_assert17.C: New test.
2021-05-26c++: constexpr and copy elision within mem init [PR100368]Patrick Palka1-7/+8
In the testcase below, the member initializer b(f()) inside C's default constructor is encoded as a TARGET_EXPR wrapping the CALL_EXPR f() in C++17 mode. During massaging of this constexpr constructor, build_target_expr_with_type called from bot_manip on this initializer tries to add an extra copy using B's implicitly deleted copy constructor rather than just preserving the copy elision. Since it's wrong to introduce an extra copy when initializing a temporary from a CALL_EXPR, this patch makes build_target_expr_with_type avoid calling force_rvalue in this case. Additionally, bot_manip should be copying TARGET_EXPRs in a more oblivious manner, so this patch makes bot_manip use force_target_expr instead of build_target_expr_with_type. And since bot_manip is now no longer a caller, we can remove the void initializer handling in build_target_expr_with_type. PR c++/100368 gcc/cp/ChangeLog: * tree.c (build_target_expr_with_type): Don't call force_rvalue on CALL_EXPR initializer. Simplify now that bot_manip is no longer a caller. (bot_manip): Use force_target_expr instead of build_target_expr_with_type. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/elide6.C: New test.
2021-05-18c++: template template parm pack expansion [PR100372]Jason Merrill1-7/+12
Here we have a pack expansion of a template template parameter pack, of which the pattern is a TEMPLATE_DECL, which strip_typedefs doesn't want to see. PR c++/100372 gcc/cp/ChangeLog: * tree.c (strip_typedefs): Only look at the pattern of a TYPE_PACK_EXPANSION if it's a type. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/alias-decl-ttp1.C: New test.
2021-05-18PR100281 C++: Fix SImode pointer handlingAndreas Krebbel1-6/+19
The problem appears to be triggered by two locations in the front-end where non-POINTER_SIZE pointers aren't handled right now. 1. An assertion in strip_typedefs is triggered because the alignment of the types don't match. This in turn is caused by creating the new type with build_pointer_type instead of taking the type of the original pointer into account. 2. An assertion in cp_convert_to_pointer is triggered which expects the target type to always have POINTER_SIZE. gcc/cp/ChangeLog: PR c++/100281 * cvt.c (cp_convert_to_pointer): Use the size of the target pointer type. * tree.c (cp_build_reference_type): Call cp_build_reference_type_for_mode with VOIDmode. (cp_build_reference_type_for_mode): Rename from cp_build_reference_type. Add MODE argument and invoke build_reference_type_for_mode. (strip_typedefs): Use build_pointer_type_for_mode and cp_build_reference_type_for_mode for pointers and references. gcc/ChangeLog: PR c++/100281 * tree.c (build_reference_type_for_mode) (build_pointer_type_for_mode): Pick pointer mode if MODE argument is VOIDmode. (build_reference_type, build_pointer_type): Invoke build_*_type_for_mode with VOIDmode. gcc/testsuite/ChangeLog: PR c++/100281 * g++.target/s390/pr100281-1.C: New test. * g++.target/s390/pr100281-2.C: New test.
2021-05-07c++: reject class lvalues in 'rvalue'Jason Merrill1-1/+6
Wrapping a class lvalue in NON_LVALUE_EXPR is not sufficient to make it a usable prvalue; callers must use force_rvalue instead. gcc/cp/ChangeLog: * tree.c (rvalue): Assert expr is not a class lvalue.
2021-05-07c++: avoid non-TARGET_EXPR class prvaluesJason Merrill1-1/+2
Around PR98469 I asked Jakub to wrap a class BIT_CAST_EXPR in TARGET_EXPR; SPACESHIP_EXPR needs the same thing. The dummy CAST_EXPR created in can_convert is another instance of a non-TARGET_EXPR prvalue, so let's use the declval-like build_stub_object there instead. gcc/cp/ChangeLog: * cp-tree.h (build_stub_object): Declare. * method.c (build_stub_object): No longer static. * call.c (can_convert): Use it. * tree.c (build_dummy_object): Adjust comment. * typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a TARGET_EXPR.
2021-04-29c++: unset COMPOUND_LITERAL_P [PR100079]Jason Merrill1-6/+2
Once a CONSTRUCTOR has been digested and used as an initializer, it no longer represents a compound literal by itself, so we can clear the flag, letting us use it consistently to distinguish between digested and undigested initializer-lists. gcc/cp/ChangeLog: * cp-tree.h: Clarify comments. * pt.c (get_template_parm_object): Add assert. * semantics.c (finish_compound_literal): Clear TREE_HAS_CONSTRUCTOR. * tree.c (zero_init_expr_p): Check TREE_HAS_CONSTRUCTOR. * typeck2.c (store_init_value): Likewise.
2021-04-16c++: C++20 class NTTP trailing zero-init [PR100079]Jason Merrill1-9/+19
The new testcase was breaking because constexpr evaluation was simplifying Bar{Baz<42>{}} to Bar{empty}, but then we weren't treating them as equivalent. Poking at this revealed that the code for eliding trailing zero-initialization in class non-type template argument mangling was pretty broken, including the test, mangle71. I dealt with the FIXME to support RANGE_EXPR, and fixed the confusion between a list-initialized temporary mangled as written (i.e. in the signature of a function template) and a template parameter object mangled as the value representation of the object. I'm distinguishing between these using COMPOUND_LITERAL_P. A later patch will adjust the use of COMPOUND_LITERAL_P to be more useful for this distinction, but it works now for distinguishing these cases in mangling. gcc/cp/ChangeLog: PR c++/100079 * cp-tree.h (first_field): Declare. * mangle.c (range_expr_nelts): New. (write_expression): Improve class NTTP mangling. * pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR. * tree.c (zero_init_expr_p): Improve class NTTP handling. * decl.c: Adjust comment. gcc/testsuite/ChangeLog: PR c++/100079 * g++.dg/abi/mangle71.C: Fix expected mangling. * g++.dg/abi/mangle77.C: New test. * g++.dg/cpp2a/nontype-class-union1.C: Likewise. * g++.dg/cpp2a/nontype-class-equiv1.C: Removed. * g++.dg/cpp2a/nontype-class44.C: New test.
2021-04-15c++: noexcept error recursion [PR100101]Jason Merrill1-5/+0
Here instantiating the noexcept-specifier for bar<void>() means instantiating A<void>::value, which complains about the conversion from 0 to int* in the default argument of foo. Since my patch for PR99583, printing the error context involves looking at C<void>::type, which again wants to instantiate A<void>::value, which breaks. For now at least, let's break this recursion by avoiding looking into the noexcept-specifier in find_typenames, and limit that to just the uses_parameter_packs case that PR99583 cares about. gcc/cp/ChangeLog: PR c++/100101 PR c++/99583 * pt.c (find_parameter_packs_r) [FUNCTION_TYPE]: Walk into TYPE_RAISES_EXCEPTIONS here. * tree.c (cp_walk_subtrees): Not here. gcc/testsuite/ChangeLog: PR c++/100101 * g++.dg/cpp0x/noexcept67.C: New test.
2021-04-01c++: variadic lambda noexcept-specifier [PR99583]Jason Merrill1-0/+5
The tree-walk looking for parameter packs didn't find this one because we weren't stepping into TYPE_RAISES_EXCEPTIONS. gcc/cp/ChangeLog: PR c++/99583 PR c++/99584 * tree.c (cp_walk_subtrees) [FUNCTION_TYPE]: Walk into TYPE_RAISES_EXCEPTIONS. gcc/testsuite/ChangeLog: PR c++/99583 * g++.dg/cpp0x/lambda/lambda-variadic12.C: New test.
2021-03-31c++: Alias template in pack expansion [PR99445]Jason Merrill1-0/+9
In this testcase, iterative_hash_template_arg checks alias_template_specialization_p to determine whether to treat a type as a dependent alias, and structural_comptypes checks dependent_alias_template_spec_p. Normally that difference isn't a problem because canonicalizing template arguments strips non-dependent aliases, but that wasn't happening for the pack expansion. Fixed thus. gcc/cp/ChangeLog: PR c++/99445 * tree.c (strip_typedefs): Handle TYPE_PACK_EXPANSION. gcc/testsuite/ChangeLog: PR c++/99445 * g++.dg/cpp0x/alias-decl-variadic1.C: New test.
2021-03-26c++: Fix ICE with nsdmi [PR99705]Jakub Jelinek1-0/+42
When adding P0784R7 constexpr new support, we still didn't have P1331R2 implemented and so I had to change also build_vec_delete_1 - instead of having uninitialized tbase temporary later initialized by MODIFY_EXPR I've set the DECL_INITIAL for it - because otherwise it would be rejected during constexpr evaluation which didn't like uninitialized vars. Unfortunately, that change broke the following testcase. The problem is that these temporaries (not just tbase but tbase was the only one with an initializer) are created during NSDMI parsing and current_function_decl is NULL at that point. Later when we clone body of constructors, auto_var_in_fn_p is false for those (as they have NULL DECL_CONTEXT) and so they aren't duplicated, and what is worse, the DECL_INITIAL isn't duplicated either nor processed, and during expansion we ICE because the code from DECL_INITIAL of that var refers to the abstract constructor's PARM_DECL (this) rather than the actual constructor's one. So, either we can just revert those build_vec_delete_1 changes (as done in the second patch - in attachment), or, as the first patch does, we can copy the temporaries during bot_manip like we copy the temporaries of TARGET_EXPRs. To me that looks like a better fix because e.g. if break_out_of_target_exprs is called for the same NSDMI multiple times, sharing the temporaries looks just wrong to me. If the temporaries are declared as BIND_EXPR_VARS of some BIND_EXPR (which is the case of the tbase variable built by build_vec_delete_1 and is the only way how the DECL_INITIAL can be walked by *walk_tree*), then we need to copy it also in the BIND_EXPR BIND_EXPR_VARS chain, other temporaries (those that don't need DECL_INITIAL) often have just DECL_EXPR and no corresponding BIND_EXPR. Note, ({ }) are rejected in nsdmis, so all we run into are temporaries the FE creates artificially. 2021-03-26 Jakub Jelinek <jakub@redhat.com> PR c++/99705 * tree.c (bot_manip): Remap artificial automatic temporaries mentioned in DECL_EXPR or in BIND_EXPR_VARS. * g++.dg/cpp0x/new5.C: New test.
2021-03-16c++: Fix NaN as C++20 template argumentJason Merrill1-1/+1
C++20 allows floating-point types for non-type template parameters; floating-point values are considered to be equivalent template arguments if they are "identical", which conveniently seems to map onto an existing GCC predicate. gcc/cp/ChangeLog: * tree.c (cp_tree_equal): Use real_identical. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/nontype-float1.C: New test.
2021-02-16c++: Revert EXPR_LOCATION change to build_aggr_init_expr [PR96997]Patrick Palka1-3/+0
My change in r10-7718 to make build_aggr_init_expr set EXPR_LOCATION (mimicking build_target_expr) causes the debuginfo regression PR96997. Given that this change is mostly independent of the rest of the commit, and that the only fallout of reverting it is a less accurate error message location in a testcase introduced in the same commit, it seems the best way forward is to just revert this part of the commit. gcc/cp/ChangeLog: PR debug/96997 PR c++/94034 * tree.c (build_aggr_init_expr): Revert r10-7718 change. gcc/testsuite/ChangeLog: PR debug/96997 PR c++/94034 * g++.dg/cpp1y/constexpr-nsdmi7b.C: Adjust expected location of "call to non-'constexpr' function" error message.
2021-02-03c++: ICE with late parsing of noexcept in nested class [PR98899]Marek Polacek1-2/+1
Here we crash with a noexcept-specifier in a nested template class, because my handling of such deferred-parse noexcept-specifiers was gronked when we need to instantiate a DEFERRED_PARSE before it was actually parsed at the end of the outermost class. In struct S { template<class> struct B { B() noexcept(noexcept(x)); int x; }; struct A : B<int> { A() : B() {} }; }; we call complete_type for B<int> which triggers tsubsting S::B<int>::B() whose noexcept-specifier still contains a DEFERRED_PARSE. The trick is to stash such noexcept-specifiers into DEFPARSE_INSTANTIATIONS so that we can replace it later when we've finally parsed all deferred noexcept-specifiers. In passing, fix missing usage of UNPARSED_NOEXCEPT_SPEC_P. gcc/cp/ChangeLog: PR c++/98899 * parser.c (cp_parser_class_specifier_1): Use any possible DEFPARSE_INSTANTIATIONS to update DEFERRED_NOEXCEPT_PATTERN. (cp_parser_save_noexcept): Initialize DEFPARSE_INSTANTIATIONS. * pt.c (tsubst_exception_specification): Stash new_specs into DEFPARSE_INSTANTIATIONS. * tree.c (fixup_deferred_exception_variants): Use UNPARSED_NOEXCEPT_SPEC_P. gcc/testsuite/ChangeLog: PR c++/98899 * g++.dg/cpp0x/noexcept65.C: New test.
2021-02-01c++: alias in qualified-id in template arg [PR98570]Jason Merrill1-6/+1
template_args_equal has handled dependent alias specializations for a while, but in this testcase the actual template argument is a SCOPE_REF, so we called cp_tree_equal, which doesn't handle aliases specially when we get to them. This patch generalizes this by setting a flag so structural_comptypes will check for template alias equivalence (if we aren't doing partial ordering). The existing flag, comparing_specializations, was too broad; in particular, when we're doing decls_match, we want to treat corresponding parameters as equivalent, so we need to separate that from alias comparison. So I introduce the comparing_dependent_aliases flag. From looking at other uses of comparing_specializations, it seems to me that the new flag is what modules wants, as well. The other use of comparing_specializations in structural_comptypes is a hack to deal with spec_hasher::equal not calling push_to_top_level, which we also don't want to tie to the alias comparison semantics. This patch also changes how we get to structural comparison of aliases from checking TYPE_CANONICAL in comptypes to marking the aliases as getting structural comparison when they are built, which is more consistent with how e.g. typename is handled. As I mention in the comment for comparing_dependent_aliases, I think the default should be to treat different dependent aliases for the same type as distinct, only treating them as equal during deduction (particularly partial ordering). But that's a matter for the C++ committee, to try in stage 1. gcc/cp/ChangeLog: PR c++/98570 * cp-tree.h: Declare it. * pt.c (comparing_dependent_aliases): New flag. (template_args_equal, spec_hasher::equal): Set it. (dependent_alias_template_spec_p): Assert that we don't get non-types other than error_mark_node. (instantiate_alias_template): SET_TYPE_STRUCTURAL_EQUALITY on complex alias specializations. Set TYPE_DEPENDENT_P here. (tsubst_decl): Not here. * module.cc (module_state::read_cluster): Set comparing_dependent_aliases instead of comparing_specializations. * tree.c (cp_tree_equal): Remove comparing_specializations module handling. * typeck.c (structural_comptypes): Adjust. (comptypes): Remove comparing_specializations handling. gcc/testsuite/ChangeLog: PR c++/98570 * g++.dg/cpp0x/alias-decl-targ1.C: New test.
2021-01-15c++: Fix qualified array-type construction [PR 98538]Nathan Sidwell1-3/+5
This was an assert that was too picky. The reason I had to alter array construction was that on stream in, we cannot dynamically determine a type's dependentness. Thus on stream out of the 'problematic' types, we save the dependentness for reconstruction. Fortunately the paths into cp_build_qualified_type_real from streamin with arrays do have the array's dependentess set as needed. PR c++/98538 gcc/cp/ * tree.c (cp_build_qualified_type_real): Propagate an array's dependentness to the copy, if known. gcc/testsuite/ * g++.dg/template/pr98538.C: New.
2021-01-15c++: Fix list-init of array of no-copy type [PR63707]Jason Merrill1-1/+9
build_vec_init_elt models initialization from some arbitrary object of the type, i.e. copy, but in the case of list-initialization we don't do a copy from the elements, we initialize them directly. gcc/cp/ChangeLog: PR c++/63707 * tree.c (build_vec_init_expr): Don't call build_vec_init_elt if we got a CONSTRUCTOR. gcc/testsuite/ChangeLog: PR c++/63707 * g++.dg/cpp0x/initlist-array13.C: New test.
2021-01-14c++: Fix erroneous parm comparison logic [PR 98372]Nathan Sidwell1-2/+2
I flubbed an application of De Morgan's law. Let's just express the logic directly and let the compiler figure it out. This bug made it look like pr52830 was fixed, but it is not. PR c++/98372 gcc/cp/ * tree.c (cp_tree_equal): Correct map_context logic. gcc/testsuite/ * g++.dg/cpp0x/constexpr-52830.C: Restore dg-ice * g++.dg/template/pr98372.C: New.
2021-01-12c++: Fix ICE with CTAD in concept [PR98611]Patrick Palka1-1/+4
This patch teaches cp_walk_subtrees to visit the template represented by a CTAD placeholder, which would otherwise be not visited during find_template_parameters. The template may be a template template parameter (as in the first testcase), or it may implicitly use the template parameters of an enclosing class template (as in the second testcase), and in either case we need to visit this tree to record the template parameters used therein for later satisfaction. gcc/cp/ChangeLog: PR c++/98611 * tree.c (cp_walk_subtrees) <case TEMPLATE_TYPE_PARM>: Visit the template of a CTAD placeholder. gcc/testsuite/ChangeLog: PR c++/98611 * g++.dg/cpp2a/concepts-ctad1.C: New test. * g++.dg/cpp2a/concepts-ctad2.C: New test.
2021-01-11c++, abi: Fix abi_tag attribute handling [PR98481]Jakub Jelinek1-6/+16
In GCC10 cp_walk_subtrees has been changed to walk template arguments. As the following testcase, that changed the mangling of some functions. I believe the previous behavior that find_abi_tags_r doesn't recurse into template args has been the correct one, but setting *walk_subtrees = 0 for the types and handling the types subtree walking manually in find_abi_tags_r looks too hard, there are a lot of subtrees and details what should and shouldn't be walked, both in tree.c (walk_type_fields there, which is static) and in cp_walk_subtrees itself. The following patch abuses the fact that *walk_subtrees is an int to tell cp_walk_subtrees it shouldn't walk the template args. Co-authored-by: Jason Merrill <jason@redhat.com> gcc/cp/ChangeLog: PR c++/98481 * class.c (find_abi_tags_r): Set *walk_subtrees to 2 instead of 1 for types. (mark_abi_tags_r): Likewise. * decl2.c (min_vis_r): Likewise. * tree.c (cp_walk_subtrees): If *walk_subtrees_p is 2, look through typedefs. gcc/testsuite/ChangeLog: PR c++/98481 * g++.dg/abi/abi-tag24.C: New test.
2021-01-04Update copyright years.Jakub Jelinek1-1/+1
2021-01-02Free datastructures pointing to CFG after parsingJan Hubicka1-0/+9
* cp-tree.h (cp_tree_c_finish_parsing): Declare. * decl2.c (c_parse_final_cleanups): Call cp_tree_c_finish_parsing. * tree.c (cp_tree_c_finish_parsing): New function.
2020-12-11c++: cp_tree_equal tweaksNathan Sidwell1-4/+18
When comparing streamed trees we can encounter NON_LVALUE_EXPR and VIEW_CONVERT_EXPRs with null types. Also, when checking a potential duplicate we don't want to reject PARM_DECLs with different contexts, if those two contexts are the two decls of interest. gcc/cp/ * cp-tree.h (map_context_from, map_context_to): Declare. * module.cc (map_context_from, map_context_to): Define. * tree.c (cp_tree_equal): Check map_context_{from,to} for parm context difference. Allow NON_LVALUE_EXPR and VIEW_CONVERT_EXPR with null types.
2020-12-07c++: Adjust array type constructionNathan Sidwell1-11/+29
This restores the dependent array changes I reverted, now that pr98116 appears fixed. As mentioned before, when deserializing a module we need to construct arrays without using the dependent-type predicates themselves. gcc/cp/ * cp-tree.h (build_cplus_array_type): Add defaulted DEP parm. * tree.c (set_array_type_common): Add DEP parm. (build_cplus_array_type): Add DEP parm, determine dependency if needed. Mark dependency of new types. (cp_build_qualified_type_real): Adjust array-building call, assert no surprising dependency. (strip_typedefs): Likewise.
2020-12-04c++: Revert dependent-array changes [PR 98116]Nathan Sidwell1-29/+11
The changes reverted here are exposing an existing problem with alias template comparisons. The typename_type changes are also incomplete, possibly for similar reasons. It seems safer to revert them, fix the underlying issue and then move forwards. The testcases is adjusted to more robustly check the specialization table, and ICEs with and without the c++ changes. Revert: 62fb1b9e0da c++: Fix array type dependency [PR 98107] 07589ca2b2c c++: typename_type structural comparison 29ae1d7751 c++: Extend build_array_type API PR c++/98116 gcc/cp/ * cp-tree.h (comparing_typenames): Delete. (cplus_build_array_type): Remove default parm. * pt.c (comparing_typenames): Delete. (spec_hasher::equal): Don't increment it. * tree.c (set_array_type_canon): Remove dep parm. (build_cplus_array_type): Remove dep parm changes. (cp_build_qualified_type_real): Remove dependent array type changes. (strip_typedefs): Likewise. * typeck.c (structural_comptypes): Revert comparing_typename changes. gcc/testsuite/ * g++.dg/template/pr98116.C: Enable robust checking.
2020-12-03c++: Exported using declsNathan Sidwell1-5/+10
With modules we need to record whethe a (namespace-scope) using decl is exporting the named entities. Record this on the OVERLOAD marking the used decl. gcc/cp/ * cp-tree.h (OVL_EXPORT): New. (class ovl_iterator): Add get_using, exporting_p. * tree.c (ovl_insert): Extend using_or_hidden meaning to include an exported using.
2020-12-03c++: Fix array type dependency [PR 98107]Nathan Sidwell1-0/+10
I'd missed some paths through build_cplus_array_type, plus, some arrays come via the C-type builder. This propagates dependency in more places and asserts that in the cases where TYPE_DEPENDENT_P_VALID is unset, the type is non-dependent. PR c++/98107 gcc/cp/ * tree.c (build_cplus_array_type): Mark dependency of new variant. (cp_build_qualified_type_real, strip_typedefs): Assert TYPE_DEPENDENT_P_VALID, or not a dependent type.
2020-12-03c++: Add __builtin_bit_cast to implement std::bit_cast [PR93121]Jakub Jelinek1-0/+2
The following patch adds __builtin_bit_cast builtin, similarly to clang or MSVC which implement std::bit_cast using such an builtin too. It checks the various std::bit_cast requirements, when not constexpr evaluated acts pretty much like VIEW_CONVERT_EXPR of the source argument to the destination type and the hardest part is obviously the constexpr evaluation. I've left out PDP11 handling of those, couldn't figure out how exactly are bitfields laid out there 2020-12-03 Jakub Jelinek <jakub@redhat.com> PR libstdc++/93121 * fold-const.h (native_encode_initializer): Add mask argument defaulted to nullptr. (find_bitfield_repr_type): Declare. (native_interpret_aggregate): Declare. * fold-const.c (find_bitfield_repr_type): New function. (native_encode_initializer): Add mask argument and support for filling it. Handle also some bitfields without integral DECL_BIT_FIELD_REPRESENTATIVE. (native_interpret_aggregate): New function. * gimple-fold.h (clear_type_padding_in_mask): Declare. * gimple-fold.c (struct clear_padding_struct): Add clear_in_mask member. (clear_padding_flush): Handle buf->clear_in_mask. (clear_padding_union): Copy clear_in_mask. Don't error if buf->clear_in_mask is set. (clear_padding_type): Don't error if buf->clear_in_mask is set. (clear_type_padding_in_mask): New function. (gimple_fold_builtin_clear_padding): Set buf.clear_in_mask to false. * doc/extend.texi (__builtin_bit_cast): Document. * c-common.h (enum rid): Add RID_BUILTIN_BIT_CAST. * c-common.c (c_common_reswords): Add __builtin_bit_cast. * cp-tree.h (cp_build_bit_cast): Declare. * cp-tree.def (BIT_CAST_EXPR): New tree code. * cp-objcp-common.c (names_builtin_p): Handle RID_BUILTIN_BIT_CAST. (cp_common_init_ts): Handle BIT_CAST_EXPR. * cxx-pretty-print.c (cxx_pretty_printer::postfix_expression): Likewise. * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_BIT_CAST. * semantics.c (cp_build_bit_cast): New function. * tree.c (cp_tree_equal): Handle BIT_CAST_EXPR. (cp_walk_subtrees): Likewise. * pt.c (tsubst_copy): Likewise. * constexpr.c (check_bit_cast_type, cxx_eval_bit_cast): New functions. (cxx_eval_constant_expression): Handle BIT_CAST_EXPR. (potential_constant_expression_1): Likewise. * cp-gimplify.c (cp_genericize_r): Likewise. * g++.dg/cpp2a/bit-cast1.C: New test. * g++.dg/cpp2a/bit-cast2.C: New test. * g++.dg/cpp2a/bit-cast3.C: New test. * g++.dg/cpp2a/bit-cast4.C: New test. * g++.dg/cpp2a/bit-cast5.C: New test.