Commit 91dfef96 by Jose E. Marchesi

GCC port for eBPF

This patch series introduces a port of GCC to eBPF, which is a virtual
machine that resides in the Linux kernel.  Initially intended for
user-level packet capture and filtering, eBPF is nowadays generalized
to serve as a general-purpose infrastructure also for non-networking
purposes.

The binutils support is already upstream.  See
https://sourceware.org/ml/binutils/2019-05/msg00306.html.

ChangeLog:

	* MAINTAINERS: Add myself as the maintainer of the eBPF port.
	Remove myself from Write After Approval section.
	* configure.ac: Support for bpf-*-* targets.
	* configure: Regenerate.

contrib/ChangeLog:

	* config-list.mk (LIST): Disable go in bpf-*-* targets.

gcc/ChangeLog:

	* doc/invoke.texi (Option Summary): Cover eBPF.
	(eBPF Options): New section.
	* doc/extend.texi (BPF Built-in Functions): Likewise.
	(BPF Kernel Helpers): Likewise.
	* config.gcc: Support for bpf-*-* targets.
	* common/config/bpf/bpf-common.c: New file.
	* config/bpf/t-bpf: Likewise.
	* config/bpf/predicates.md: Likewise.
	* config/bpf/constraints.md: Likewise.
	* config/bpf/bpf.opt: Likewise.
	* config/bpf/bpf.md: Likewise.
	* config/bpf/bpf.h: Likewise.
	* config/bpf/bpf.c: Likewise.
	* config/bpf/bpf-protos.h: Likewise.
	* config/bpf/bpf-opts.h: Likewise.
	* config/bpf/bpf-helpers.h: Likewise.
	* config/bpf/bpf-helpers.def: Likewise.

gcc/testsuite/ChangeLog:

	* gcc.dg/builtins-config.h: eBPF doesn't support C99 standard
	functions.
	* gcc.c-torture/compile/20101217-1.c: Add a function prototype for
	printf.
	* gcc.c-torture/compile/20000211-1.c: Skip if target bpf-*-*.
	* gcc.c-torture/compile/poor.c: Likewise.
	* gcc.c-torture/compile/pr25311.c: Likewise.
	* gcc.c-torture/compile/pr39928-1.c: Likewise.
	* gcc.c-torture/compile/pr70061.c: Likewise.
	* gcc.c-torture/compile/920501-7.c: Likewise.
	* gcc.c-torture/compile/20000403-1.c: Likewise.
	* gcc.c-torture/compile/20001226-1.c: Likewise.
	* gcc.c-torture/compile/20030903-1.c: Likewise.
	* gcc.c-torture/compile/20031125-1.c: Likewise.
	* gcc.c-torture/compile/20040101-1.c: Likewise.
	* gcc.c-torture/compile/20040317-2.c: Likewise.
	* gcc.c-torture/compile/20040726-1.c: Likewise.
	* gcc.c-torture/compile/20051216-1.c: Likewise.
	* gcc.c-torture/compile/900313-1.c: Likewise.
	* gcc.c-torture/compile/920625-1.c: Likewise.
	* gcc.c-torture/compile/930421-1.c: Likewise.
	* gcc.c-torture/compile/930623-1.c: Likewise.
	* gcc.c-torture/compile/961004-1.c: Likewise.
	* gcc.c-torture/compile/980504-1.c: Likewise.
	* gcc.c-torture/compile/980816-1.c: Likewise.
	* gcc.c-torture/compile/990625-1.c: Likewise.
	* gcc.c-torture/compile/DFcmp.c: Likewise.
	* gcc.c-torture/compile/HIcmp.c: Likewise.
	* gcc.c-torture/compile/HIset.c: Likewise.
	* gcc.c-torture/compile/QIcmp.c: Likewise.
	* gcc.c-torture/compile/QIset.c: Likewise.
	* gcc.c-torture/compile/SFset.c: Likewise.
	* gcc.c-torture/compile/SIcmp.c: Likewise.
	* gcc.c-torture/compile/SIset.c: Likewise.
	* gcc.c-torture/compile/UHIcmp.c: Likewise.
	* gcc.c-torture/compile/UQIcmp.c: Likewise.
	* gcc.c-torture/compile/USIcmp.c: Likewise.
	* gcc.c-torture/compile/consec.c: Likewise.
	* gcc.c-torture/compile/limits-fndefn.c: Likewise.
	* gcc.c-torture/compile/lll.c: Likewise.
	* gcc.c-torture/compile/parms.c: Likewise.
	* gcc.c-torture/compile/pass.c: Likewise.
	* gcc.c-torture/compile/pp.c: Likewise.
	* gcc.c-torture/compile/pr32399.c: Likewise.
	* gcc.c-torture/compile/pr34091.c: Likewise.
	* gcc.c-torture/compile/pr34688.c: Likewise.
	* gcc.c-torture/compile/pr37258.c: Likewise.
	* gcc.c-torture/compile/pr37327.c: Likewise.
	* gcc.c-torture/compile/pr37381.c: Likewise.
	* gcc.c-torture/compile/pr37669-2.c: Likewise.
	* gcc.c-torture/compile/pr37669.c: Likewise.
	* gcc.c-torture/compile/pr37742-3.c: Likewise.
	* gcc.c-torture/compile/pr44063.c: Likewise.
	* gcc.c-torture/compile/pr48596.c: Likewise.
	* gcc.c-torture/compile/pr51856.c: Likewise.
	* gcc.c-torture/compile/pr54428.c: Likewise.
	* gcc.c-torture/compile/pr54713-1.c: Likewise.
	* gcc.c-torture/compile/pr54713-2.c: Likewise.
	* gcc.c-torture/compile/pr54713-3.c: Likewise.
	* gcc.c-torture/compile/pr55921.c: Likewise.
	* gcc.c-torture/compile/pr70240.c: Likewise.
	* gcc.c-torture/compile/pr70355.c: Likewise.
	* gcc.c-torture/compile/pr82052.c: Likewise.
	* gcc.c-torture/compile/pr83487.c: Likewise.
	* gcc.c-torture/compile/pr86122.c: Likewise.
	* gcc.c-torture/compile/pret-arg.c: Likewise.
	* gcc.c-torture/compile/regs-arg-size.c: Likewise.
	* gcc.c-torture/compile/structret.c: Likewise.
	* gcc.c-torture/compile/uuarg.c: Likewise.
	* gcc.dg/20001009-1.c: Likewise.
	* gcc.dg/20020418-1.c: Likewise.
	* gcc.dg/20020426-2.c: Likewise.
	* gcc.dg/20020430-1.c: Likewise.
	* gcc.dg/20040306-1.c: Likewise.
	* gcc.dg/20040622-2.c: Likewise.
	* gcc.dg/20050603-2.c: Likewise.
	* gcc.dg/20050629-1.c: Likewise.
	* gcc.dg/20061026.c: Likewise.
	* gcc.dg/Warray-bounds-3.c: Likewise.
	* gcc.dg/Warray-bounds-30.c: Likewise.
	* gcc.dg/Wframe-larger-than-2.c: Likewise.
	* gcc.dg/Wframe-larger-than.c: Likewise.
	* gcc.dg/Wrestrict-11.c: Likewise.
	* gcc.c-torture/compile/20000804-1.c: Likewise.
	* lib/target-supports.exp (check_effective_target_trampolines):
	Adapt to eBPF.
	(check_effective_target_indirect_jumps): Likewise.
	(check_effective_target_nonlocal_goto): Likewise.
	(check_effective_target_global_constructor): Likewise.
	(check_effective_target_return_address): Likewise.
	* gcc.target/bpf/bpf.exp: New file.
	* gcc.target/bpf/builtin-load.c: Likewise.
	* cc.target/bpf/constant-calls.c: Likewise.
	* gcc.target/bpf/diag-funargs.c: Likewise.
	* gcc.target/bpf/diag-funargs-2.c: Likewise.
	* gcc.target/bpf/diag-funargs-3.c: Likewise.
	* gcc.target/bpf/diag-indcalls.c: Likewise.
	* gcc.target/bpf/helper-bind.c: Likewise.
	* gcc.target/bpf/helper-bpf-redirect.c: Likewise.
	* gcc.target/bpf/helper-clone-redirect.c: Likewise.
	* gcc.target/bpf/helper-csum-diff.c: Likewise.
	* gcc.target/bpf/helper-csum-update.c: Likewise.
	* gcc.target/bpf/helper-current-task-under-cgroup.c: Likewise.
	* gcc.target/bpf/helper-fib-lookup.c: Likewise.
	* gcc.target/bpf/helper-get-cgroup-classid.c: Likewise.
	* gcc.target/bpf/helper-get-current-cgroup-id.c: Likewise.
	* gcc.target/bpf/helper-get-current-comm.c: Likewise.
	* gcc.target/bpf/helper-get-current-pid-tgid.c: Likewise.
	* gcc.target/bpf/helper-get-current-task.c: Likewise.
	* gcc.target/bpf/helper-get-current-uid-gid.c: Likewise.
	* gcc.target/bpf/helper-get-hash-recalc.c: Likewise.
	* gcc.target/bpf/helper-get-listener-sock.c: Likewise.
	* gcc.target/bpf/helper-get-local-storage.c: Likewise.
	* gcc.target/bpf/helper-get-numa-node-id.c: Likewise.
	* gcc.target/bpf/helper-get-prandom-u32.c: Likewise.
	* gcc.target/bpf/helper-get-route-realm.c: Likewise.
	* gcc.target/bpf/helper-get-smp-processor-id.c: Likewise.
	* gcc.target/bpf/helper-get-socket-cookie.c: Likewise.
	* gcc.target/bpf/helper-get-socket-uid.c: Likewise.
	* gcc.target/bpf/helper-getsockopt.c: Likewise.
	* gcc.target/bpf/helper-get-stack.c: Likewise.
	* gcc.target/bpf/helper-get-stackid.c: Likewise.
	* gcc.target/bpf/helper-ktime-get-ns.c: Likewise.
	* gcc.target/bpf/helper-l3-csum-replace.c: Likewise.
	* gcc.target/bpf/helper-l4-csum-replace.c: Likewise.
	* gcc.target/bpf/helper-lwt-push-encap.c: Likewise.
	* gcc.target/bpf/helper-lwt-seg6-action.c: Likewise.
	* gcc.target/bpf/helper-lwt-seg6-adjust-srh.c: Likewise.
	* gcc.target/bpf/helper-lwt-seg6-store-bytes.c: Likewise.
	* gcc.target/bpf/helper-map-delete-elem.c: Likewise.
	* gcc.target/bpf/helper-map-lookup-elem.c: Likewise.
	* gcc.target/bpf/helper-map-peek-elem.c: Likewise.
	* gcc.target/bpf/helper-map-pop-elem.c: Likewise.
	* gcc.target/bpf/helper-map-push-elem.c: Likewise.
	* gcc.target/bpf/helper-map-update-elem.c: Likewise.
	* gcc.target/bpf/helper-msg-apply-bytes.c: Likewise.
	* gcc.target/bpf/helper-msg-cork-bytes.c: Likewise.
	* gcc.target/bpf/helper-msg-pop-data.c: Likewise.
	* gcc.target/bpf/helper-msg-pull-data.c: Likewise.
	* gcc.target/bpf/helper-msg-push-data.c: Likewise.
	* gcc.target/bpf/helper-msg-redirect-hash.c: Likewise.
	* gcc.target/bpf/helper-msg-redirect-map.c: Likewise.
	* gcc.target/bpf/helper-override-return.c: Likewise.
	* gcc.target/bpf/helper-perf-event-output.c: Likewise.
	* gcc.target/bpf/helper-perf-event-read.c: Likewise.
	* gcc.target/bpf/helper-perf-event-read-value.c: Likewise.
	* gcc.target/bpf/helper-perf-prog-read-value.c: Likewise.
	* gcc.target/bpf/helper-probe-read.c: Likewise.
	* gcc.target/bpf/helper-probe-read-str.c: Likewise.
	* gcc.target/bpf/helper-probe-write-user.c: Likewise.
	* gcc.target/bpf/helper-rc-keydown.c: Likewise.
	* gcc.target/bpf/helper-rc-pointer-rel.c: Likewise.
	* gcc.target/bpf/helper-rc-repeat.c: Likewise.
	* gcc.target/bpf/helper-redirect-map.c: Likewise.
	* gcc.target/bpf/helper-set-hash.c: Likewise.
	* gcc.target/bpf/helper-set-hash-invalid.c: Likewise.
	* gcc.target/bpf/helper-setsockopt.c: Likewise.
	* gcc.target/bpf/helper-skb-adjust-room.c: Likewise.
	* gcc.target/bpf/helper-skb-cgroup-id.c: Likewise.
	* gcc.target/bpf/helper-skb-change-head.c: Likewise.
	* gcc.target/bpf/helper-skb-change-proto.c: Likewise.
	* gcc.target/bpf/helper-skb-change-tail.c: Likewise.
	* gcc.target/bpf/helper-skb-change-type.c: Likewise.
	* gcc.target/bpf/helper-skb-ecn-set-ce.c: Likewise.
	* gcc.target/bpf/helper-skb-get-tunnel-key.c: Likewise.
	* gcc.target/bpf/helper-skb-get-tunnel-opt.c: Likewise.
	* gcc.target/bpf/helper-skb-get-xfrm-state.c: Likewise.
	* gcc.target/bpf/helper-skb-load-bytes.c: Likewise.
	* gcc.target/bpf/helper-skb-load-bytes-relative.c: Likewise.
	* gcc.target/bpf/helper-skb-pull-data.c: Likewise.
	* gcc.target/bpf/helper-skb-set-tunnel-key.c: Likewise.
	* gcc.target/bpf/helper-skb-set-tunnel-opt.c: Likewise.
	* gcc.target/bpf/helper-skb-store-bytes.c: Likewise.
	* gcc.target/bpf/helper-skb-under-cgroup.c: Likewise.
	* gcc.target/bpf/helper-skb-vlan-pop.c: Likewise.
	* gcc.target/bpf/helper-skb-vlan-push.c: Likewise.
	* gcc.target/bpf/helper-skc-lookup-tcp.c: Likewise.
	* gcc.target/bpf/helper-sk-fullsock.c: Likewise.
	* gcc.target/bpf/helper-sk-lookup-tcp.c: Likewise.
	* gcc.target/bpf/helper-sk-lookup-upd.c: Likewise.
	* gcc.target/bpf/helper-sk-redirect-hash.c: Likewise.
	* gcc.target/bpf/helper-sk-redirect-map.c: Likewise.
	* gcc.target/bpf/helper-sk-release.c: Likewise.
	* gcc.target/bpf/helper-sk-select-reuseport.c: Likewise.
	* gcc.target/bpf/helper-sk-storage-delete.c: Likewise.
	* gcc.target/bpf/helper-sk-storage-get.c: Likewise.
	* gcc.target/bpf/helper-sock-hash-update.c: Likewise.
	* gcc.target/bpf/helper-sock-map-update.c: Likewise.
	* gcc.target/bpf/helper-sock-ops-cb-flags-set.c: Likewise.
	* gcc.target/bpf/helper-spin-lock.c: Likewise.
	* gcc.target/bpf/helper-spin-unlock.c: Likewise.
	* gcc.target/bpf/helper-strtol.c: Likewise.
	* gcc.target/bpf/helper-strtoul.c: Likewise.
	* gcc.target/bpf/helper-sysctl-get-current-value.c: Likewise.
	* gcc.target/bpf/helper-sysctl-get-name.c: Likewise.
	* gcc.target/bpf/helper-sysctl-get-new-value.c: Likewise.
	* gcc.target/bpf/helper-sysctl-set-new-value.c: Likewise.
	* gcc.target/bpf/helper-tail-call.c: Likewise.
	* gcc.target/bpf/helper-tcp-check-syncookie.c: Likewise.
	* gcc.target/bpf/helper-tcp-sock.c: Likewise.
	* gcc.target/bpf/helper-trace-printk.c: Likewise.
	* gcc.target/bpf/helper-xdp-adjust-head.c: Likewise.
	* gcc.target/bpf/helper-xdp-adjust-meta.c: Likewise.
	* gcc.target/bpf/helper-xdp-adjust-tail.c: Likewise.
	* gcc.target/bpf/skb-ancestor-cgroup-id.c: Likewise.
	* gcc.target/bpf/sync-fetch-and-add.c: Likewise.

libgcc/ChangeLog:

	* config.host: Set cpu_type for bpf-*-* targets.
	* config/bpf/t-bpf: Likewise.
	* config/bpf/crtn.S: Likewise.
	* config/bpf/crti.S: New file.

From-SVN: r275506
parent a5362c6a
2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com> 2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
* MAINTAINERS: Add myself as the maintainer of the eBPF port.
Remove myself from Write After Approval section.
2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
* configure.ac: Support for bpf-*-* targets.
* configure: Regenerate.
2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
* config.sub: Import upstream version 2019-06-30. * config.sub: Import upstream version 2019-06-30.
* config.guess: Import upstream version 2019-07-24. * config.guess: Import upstream version 2019-07-24.
......
...@@ -57,6 +57,7 @@ arm port Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> ...@@ -57,6 +57,7 @@ arm port Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
arm port Kyrylo Tkachov <kyrylo.tkachov@arm.com> arm port Kyrylo Tkachov <kyrylo.tkachov@arm.com>
avr port Denis Chertykov <chertykov@gmail.com> avr port Denis Chertykov <chertykov@gmail.com>
bfin port Jie Zhang <jzhang918@gmail.com> bfin port Jie Zhang <jzhang918@gmail.com>
bpf port Jose E. Marchesi <jose.marchesi@oracle.com>
c6x port Bernd Schmidt <bernds_cb1@t-online.de> c6x port Bernd Schmidt <bernds_cb1@t-online.de>
cris port Hans-Peter Nilsson <hp@axis.com> cris port Hans-Peter Nilsson <hp@axis.com>
c-sky port Xianmiao Qu <xianmiao_qu@c-sky.com> c-sky port Xianmiao Qu <xianmiao_qu@c-sky.com>
...@@ -494,7 +495,6 @@ Luis Machado <luisgpm@br.ibm.com> ...@@ -494,7 +495,6 @@ Luis Machado <luisgpm@br.ibm.com>
Ziga Mahkovec <ziga.mahkovec@klika.si> Ziga Mahkovec <ziga.mahkovec@klika.si>
Matthew Malcomson <matthew.malcomson@arm.com> Matthew Malcomson <matthew.malcomson@arm.com>
Mikhail Maltsev <maltsevm@gmail.com> Mikhail Maltsev <maltsevm@gmail.com>
Jose E. Marchesi <jose.marchesi@oracle.com>
Patrick Marlier <patrick.marlier@gmail.com> Patrick Marlier <patrick.marlier@gmail.com>
Simon Martin <simartin@users.sourceforge.net> Simon Martin <simartin@users.sourceforge.net>
Alejandro Martinez <alejandro.martinezvicente@arm.com> Alejandro Martinez <alejandro.martinezvicente@arm.com>
......
...@@ -3357,6 +3357,9 @@ case "${target}" in ...@@ -3357,6 +3357,9 @@ case "${target}" in
# No hosted I/O support. # No hosted I/O support.
noconfigdirs="$noconfigdirs target-libssp" noconfigdirs="$noconfigdirs target-libssp"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libssp"
;;
powerpc-*-aix* | rs6000-*-aix*) powerpc-*-aix* | rs6000-*-aix*)
noconfigdirs="$noconfigdirs target-libssp" noconfigdirs="$noconfigdirs target-libssp"
;; ;;
...@@ -3391,12 +3394,43 @@ if test "${ENABLE_LIBSTDCXX}" = "default" ; then ...@@ -3391,12 +3394,43 @@ if test "${ENABLE_LIBSTDCXX}" = "default" ; then
avr-*-*) avr-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3" noconfigdirs="$noconfigdirs target-libstdc++-v3"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3"
;;
ft32-*-*) ft32-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3" noconfigdirs="$noconfigdirs target-libstdc++-v3"
;; ;;
esac esac
fi fi
# Disable C++ on systems where it is known to not work.
# For testing, you can override this with --enable-languages=c++.
case ,${enable_languages}, in
*,c++,*)
;;
*)
case "${target}" in
bpf-*-*)
unsupported_languages="$unsupported_languages c++"
;;
esac
;;
esac
# Disable Objc on systems where it is known to not work.
# For testing, you can override this with --enable-languages=objc.
case ,${enable_languages}, in
*,objc,*)
;;
*)
case "${target}" in
bpf-*-*)
unsupported_languages="$unsupported_languages objc"
;;
esac
;;
esac
# Disable D on systems where it is known to not work. # Disable D on systems where it is known to not work.
# For testing, you can override this with --enable-languages=d. # For testing, you can override this with --enable-languages=d.
case ,${enable_languages}, in case ,${enable_languages}, in
...@@ -3406,6 +3440,9 @@ case ,${enable_languages}, in ...@@ -3406,6 +3440,9 @@ case ,${enable_languages}, in
case "${target}" in case "${target}" in
*-*-darwin*) *-*-darwin*)
unsupported_languages="$unsupported_languages d" unsupported_languages="$unsupported_languages d"
;;
bpf-*-*)
unsupported_languages="$unsupported_languages d"
;; ;;
esac esac
;; ;;
...@@ -3437,6 +3474,9 @@ case "${target}" in ...@@ -3437,6 +3474,9 @@ case "${target}" in
# See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>. # See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>.
unsupported_languages="$unsupported_languages fortran" unsupported_languages="$unsupported_languages fortran"
;; ;;
bpf-*-*)
unsupported_languages="$unsupported_languages fortran"
;;
esac esac
# Disable libffi for some systems. # Disable libffi for some systems.
...@@ -3483,6 +3523,9 @@ case "${target}" in ...@@ -3483,6 +3523,9 @@ case "${target}" in
arm*-*-symbianelf*) arm*-*-symbianelf*)
noconfigdirs="$noconfigdirs target-libffi" noconfigdirs="$noconfigdirs target-libffi"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libffi"
;;
cris-*-* | crisv32-*-*) cris-*-* | crisv32-*-*)
case "${target}" in case "${target}" in
*-*-linux*) *-*-linux*)
...@@ -3529,7 +3572,7 @@ esac ...@@ -3529,7 +3572,7 @@ esac
# Disable the go frontend on systems where it is known to not work. Please keep # Disable the go frontend on systems where it is known to not work. Please keep
# this in sync with contrib/config-list.mk. # this in sync with contrib/config-list.mk.
case "${target}" in case "${target}" in
*-*-darwin* | *-*-cygwin* | *-*-mingw*) *-*-darwin* | *-*-cygwin* | *-*-mingw* | bpf-* )
unsupported_languages="$unsupported_languages go" unsupported_languages="$unsupported_languages go"
;; ;;
esac esac
...@@ -3545,6 +3588,9 @@ if test x$enable_libgo = x; then ...@@ -3545,6 +3588,9 @@ if test x$enable_libgo = x; then
*-*-cygwin* | *-*-mingw*) *-*-cygwin* | *-*-mingw*)
noconfigdirs="$noconfigdirs target-libgo" noconfigdirs="$noconfigdirs target-libgo"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libgo"
;;
esac esac
fi fi
...@@ -3616,6 +3662,9 @@ case "${target}" in ...@@ -3616,6 +3662,9 @@ case "${target}" in
sparc-*-sunos4*) sparc-*-sunos4*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss" noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
*-*-aix*) *-*-aix*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss" noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;; ;;
...@@ -3729,6 +3778,9 @@ case "${target}" in ...@@ -3729,6 +3778,9 @@ case "${target}" in
# newlib is not 64 bit ready # newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss" noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libobjc target-libbacktrace"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe) sh*-*-pe|mips*-*-pe|*arm-wince-pe)
noconfigdirs="$noconfigdirs tcl tk itcl libgui sim" noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
;; ;;
......
...@@ -638,6 +638,9 @@ case "${target}" in ...@@ -638,6 +638,9 @@ case "${target}" in
# No hosted I/O support. # No hosted I/O support.
noconfigdirs="$noconfigdirs target-libssp" noconfigdirs="$noconfigdirs target-libssp"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libssp"
;;
powerpc-*-aix* | rs6000-*-aix*) powerpc-*-aix* | rs6000-*-aix*)
noconfigdirs="$noconfigdirs target-libssp" noconfigdirs="$noconfigdirs target-libssp"
;; ;;
...@@ -672,12 +675,43 @@ if test "${ENABLE_LIBSTDCXX}" = "default" ; then ...@@ -672,12 +675,43 @@ if test "${ENABLE_LIBSTDCXX}" = "default" ; then
avr-*-*) avr-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3" noconfigdirs="$noconfigdirs target-libstdc++-v3"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3"
;;
ft32-*-*) ft32-*-*)
noconfigdirs="$noconfigdirs target-libstdc++-v3" noconfigdirs="$noconfigdirs target-libstdc++-v3"
;; ;;
esac esac
fi fi
# Disable C++ on systems where it is known to not work.
# For testing, you can override this with --enable-languages=c++.
case ,${enable_languages}, in
*,c++,*)
;;
*)
case "${target}" in
bpf-*-*)
unsupported_languages="$unsupported_languages c++"
;;
esac
;;
esac
# Disable Objc on systems where it is known to not work.
# For testing, you can override this with --enable-languages=objc.
case ,${enable_languages}, in
*,objc,*)
;;
*)
case "${target}" in
bpf-*-*)
unsupported_languages="$unsupported_languages objc"
;;
esac
;;
esac
# Disable D on systems where it is known to not work. # Disable D on systems where it is known to not work.
# For testing, you can override this with --enable-languages=d. # For testing, you can override this with --enable-languages=d.
case ,${enable_languages}, in case ,${enable_languages}, in
...@@ -687,6 +721,9 @@ case ,${enable_languages}, in ...@@ -687,6 +721,9 @@ case ,${enable_languages}, in
case "${target}" in case "${target}" in
*-*-darwin*) *-*-darwin*)
unsupported_languages="$unsupported_languages d" unsupported_languages="$unsupported_languages d"
;;
bpf-*-*)
unsupported_languages="$unsupported_languages d"
;; ;;
esac esac
;; ;;
...@@ -715,6 +752,9 @@ case "${target}" in ...@@ -715,6 +752,9 @@ case "${target}" in
# See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>. # See <http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00572.html>.
unsupported_languages="$unsupported_languages fortran" unsupported_languages="$unsupported_languages fortran"
;; ;;
bpf-*-*)
unsupported_languages="$unsupported_languages fortran"
;;
esac esac
# Disable libffi for some systems. # Disable libffi for some systems.
...@@ -761,6 +801,9 @@ case "${target}" in ...@@ -761,6 +801,9 @@ case "${target}" in
arm*-*-symbianelf*) arm*-*-symbianelf*)
noconfigdirs="$noconfigdirs target-libffi" noconfigdirs="$noconfigdirs target-libffi"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libffi"
;;
cris-*-* | crisv32-*-*) cris-*-* | crisv32-*-*)
case "${target}" in case "${target}" in
*-*-linux*) *-*-linux*)
...@@ -807,7 +850,7 @@ esac ...@@ -807,7 +850,7 @@ esac
# Disable the go frontend on systems where it is known to not work. Please keep # Disable the go frontend on systems where it is known to not work. Please keep
# this in sync with contrib/config-list.mk. # this in sync with contrib/config-list.mk.
case "${target}" in case "${target}" in
*-*-darwin* | *-*-cygwin* | *-*-mingw*) *-*-darwin* | *-*-cygwin* | *-*-mingw* | bpf-* )
unsupported_languages="$unsupported_languages go" unsupported_languages="$unsupported_languages go"
;; ;;
esac esac
...@@ -823,6 +866,9 @@ if test x$enable_libgo = x; then ...@@ -823,6 +866,9 @@ if test x$enable_libgo = x; then
*-*-cygwin* | *-*-mingw*) *-*-cygwin* | *-*-mingw*)
noconfigdirs="$noconfigdirs target-libgo" noconfigdirs="$noconfigdirs target-libgo"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libgo"
;;
esac esac
fi fi
...@@ -894,6 +940,9 @@ case "${target}" in ...@@ -894,6 +940,9 @@ case "${target}" in
sparc-*-sunos4*) sparc-*-sunos4*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss" noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
*-*-aix*) *-*-aix*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss" noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;; ;;
...@@ -1007,6 +1056,9 @@ case "${target}" in ...@@ -1007,6 +1056,9 @@ case "${target}" in
# newlib is not 64 bit ready # newlib is not 64 bit ready
noconfigdirs="$noconfigdirs target-newlib target-libgloss" noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;; ;;
bpf-*-*)
noconfigdirs="$noconfigdirs target-libobjc target-libbacktrace"
;;
sh*-*-pe|mips*-*-pe|*arm-wince-pe) sh*-*-pe|mips*-*-pe|*arm-wince-pe)
noconfigdirs="$noconfigdirs tcl tk itcl libgui sim" noconfigdirs="$noconfigdirs tcl tk itcl libgui sim"
;; ;;
......
2019-09-09 Jose E. Marchesi <jemarch@gnu.org>
* config-list.mk (LIST): Disable go in bpf-*-* targets.
2019-09-04 Martin Liska <mliska@suse.cz> 2019-09-04 Martin Liska <mliska@suse.cz>
* mklog: Do not print changed functions for * mklog: Do not print changed functions for
......
...@@ -40,6 +40,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \ ...@@ -40,6 +40,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
arm-linux-androideabi arm-uclinux_eabi arm-eabi arm-rtems \ arm-linux-androideabi arm-uclinux_eabi arm-eabi arm-rtems \
arm-symbianelf avr-elf \ arm-symbianelf avr-elf \
bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \ bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \
bpf-unknown-none \
c6x-elf c6x-uclinux cr16-elf cris-elf cris-linux crisv32-elf crisv32-linux \ c6x-elf c6x-uclinux cr16-elf cris-elf cris-linux crisv32-elf crisv32-linux \
csky-elf csky-linux-gnu \ csky-elf csky-linux-gnu \
epiphany-elf epiphany-elfOPT-with-stack-offset=16 fido-elf \ epiphany-elf epiphany-elfOPT-with-stack-offset=16 fido-elf \
...@@ -123,7 +124,7 @@ $(LIST): make-log-dir ...@@ -123,7 +124,7 @@ $(LIST): make-log-dir
TGT=`echo $@ | awk 'BEGIN { FS = "OPT" }; { print $$1 }'` && \ TGT=`echo $@ | awk 'BEGIN { FS = "OPT" }; { print $$1 }'` && \
TGT=`$(GCC_SRC_DIR)/config.sub $$TGT` && \ TGT=`$(GCC_SRC_DIR)/config.sub $$TGT` && \
case $$TGT in \ case $$TGT in \
*-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix*) \ *-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix* | bpf-*-*) \
ADDITIONAL_LANGUAGES=""; \ ADDITIONAL_LANGUAGES=""; \
;; \ ;; \
*) \ *) \
......
2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com> 2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
* doc/invoke.texi (Option Summary): Cover eBPF.
(eBPF Options): New section.
* doc/extend.texi (BPF Built-in Functions): Likewise.
(BPF Kernel Helpers): Likewise.
2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
* config.gcc: Support for bpf-*-* targets.
* common/config/bpf/bpf-common.c: New file.
* config/bpf/t-bpf: Likewise.
* config/bpf/predicates.md: Likewise.
* config/bpf/constraints.md: Likewise.
* config/bpf/bpf.opt: Likewise.
* config/bpf/bpf.md: Likewise.
* config/bpf/bpf.h: Likewise.
* config/bpf/bpf.c: Likewise.
* config/bpf/bpf-protos.h: Likewise.
* config/bpf/bpf-opts.h: Likewise.
* config/bpf/bpf-helpers.h: Likewise.
* config/bpf/bpf-helpers.def: Likewise.
2019-09-09 Jose E. Marchesi <jose.marchesi@oracle.com>
* doc/sourcebuild.texi (Effective-Target Keywords): Document * doc/sourcebuild.texi (Effective-Target Keywords): Document
indirect_calls. indirect_calls.
......
/* Common hooks for eBPF.
Copyright (C) 2019 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "common/common-target.h"
#include "common/common-target-def.h"
#include "config/bpf/bpf-protos.h"
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS 0
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
static const struct default_options bpf_option_optimization_table[] =
{
/* Enable -funroll-all-loops by default. */
{ OPT_LEVELS_ALL, OPT_funroll_all_loops, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
#undef TARGET_OPTION_OPTIMIZATION_TABLE
#define TARGET_OPTION_OPTIMIZATION_TABLE bpf_option_optimization_table
/* Implement TARGET_OPTION_DEFAULT_PARAMS. */
static void
bpf_option_default_params (void)
{
/* XXX large-stack-frame = 512 bytes */
/* XXX max-unrolled-insns */
/* XXX max-unroll-times */
}
#undef TARGET_OPTION_DEFAULT_PARAMS
#define TARGET_OPTION_DEFAULT_PARAMS bpf_option_default_params
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
...@@ -360,6 +360,9 @@ avr-*-*) ...@@ -360,6 +360,9 @@ avr-*-*)
bfin*-*) bfin*-*)
cpu_type=bfin cpu_type=bfin
;; ;;
bpf-*-*)
cpu_type=bpf
;;
crisv32-*) crisv32-*)
cpu_type=cris cpu_type=cris
;; ;;
...@@ -1308,6 +1311,12 @@ bfin*-*) ...@@ -1308,6 +1311,12 @@ bfin*-*)
use_collect2=no use_collect2=no
use_gcc_stdint=wrap use_gcc_stdint=wrap
;; ;;
bpf-*-*)
tmake_file="${tmake_file} bpf/t-bpf"
use_collect2=no
extra_headers="bpf-helpers.h"
use_gcc_stdint=provide
;;
cr16-*-elf) cr16-*-elf)
tm_file="elfos.h ${tm_file} newlib-stdint.h" tm_file="elfos.h ${tm_file} newlib-stdint.h"
tmake_file="${tmake_file} cr16/t-cr16 " tmake_file="${tmake_file} cr16/t-cr16 "
......
/* Definitions for option handling for eBPF.
Copyright (C) 2019 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef BPF_OPTS_H
#define BPF_OPTS_H
/* Supported versions of the Linux kernel. */
enum bpf_kernel_version
{
/* Linux 4.x */
LINUX_V4_0,
LINUX_V4_1,
LINUX_V4_2,
LINUX_V4_3,
LINUX_V4_4,
LINUX_V4_5,
LINUX_V4_6,
LINUX_V4_7,
LINUX_V4_8,
LINUX_V4_9,
LINUX_V4_10,
LINUX_V4_11,
LINUX_V4_12,
LINUX_V4_13,
LINUX_V4_14,
LINUX_V4_15,
LINUX_V4_16,
LINUX_V4_17,
LINUX_V4_18,
LINUX_V4_19,
LINUX_V4_20,
/* Linux 5.x */
LINUX_V5_0,
LINUX_V5_1,
LINUX_V5_2,
LINUX_LATEST = LINUX_V5_2,
LINUX_NATIVE,
};
#endif /* ! BPF_OPTS_H */
/* Definition of eBPF target for GNU compiler.
Copyright (C) 2019 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_BPF_PROTOS_H
#define GCC_BPF_PROTOS_H
/* Routines implemented in bpf.c. */
extern HOST_WIDE_INT bpf_initial_elimination_offset (int, int);
extern const char *bpf_output_call (rtx);
extern void bpf_target_macros (cpp_reader *);
extern void bpf_print_operand (FILE *, rtx, int);
extern void bpf_print_operand_address (FILE *, rtx);
extern void bpf_expand_prologue (void);
extern void bpf_expand_epilogue (void);
#endif /* ! GCC_BPF_PROTOS_H */
; Options for the eBPF compiler port.
; Copyright (C) 2019 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC is free software; you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free
; Software Foundation; either version 3, or (at your option) any later
; version.
;
; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
; WARRANTY; without even the implied warranty of MERCHANTABILITY or
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
; for more details.
;
; You should have received a copy of the GNU General Public License
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
HeaderInclude
config/bpf/bpf-opts.h
; Selecting the kind of kernel the eBPF will be running on.
mkernel=
Target RejectNegative Joined Var(bpf_kernel) Enum(bpf_kernel) Init(LINUX_LATEST)
Generate eBPF for the given Linux kernel version.
Enum
Name(bpf_kernel) Type(enum bpf_kernel_version)
EnumValue
Enum(bpf_kernel) String(native) Value(LINUX_NATIVE) DriverOnly
EnumValue
Enum(bpf_kernel) String(latest) Value(LINUX_LATEST) DriverOnly
EnumValue
Enum(bpf_kernel) String(4.0) Value(LINUX_V4_0)
EnumValue
Enum(bpf_kernel) String(4.1) Value(LINUX_V4_1)
EnumValue
Enum(bpf_kernel) String(4.2) Value(LINUX_V4_2)
EnumValue
Enum(bpf_kernel) String(4.3) Value(LINUX_V4_3)
EnumValue
Enum(bpf_kernel) String(4.4) Value(LINUX_V4_4)
EnumValue
Enum(bpf_kernel) String(4.5) Value(LINUX_V4_5)
EnumValue
Enum(bpf_kernel) String(4.6) Value(LINUX_V4_6)
EnumValue
Enum(bpf_kernel) String(4.7) Value(LINUX_V4_7)
EnumValue
Enum(bpf_kernel) String(4.8) Value(LINUX_V4_8)
EnumValue
Enum(bpf_kernel) String(4.9) Value(LINUX_V4_9)
EnumValue
Enum(bpf_kernel) String(4.10) Value(LINUX_V4_10)
EnumValue
Enum(bpf_kernel) String(4.11) Value(LINUX_V4_11)
EnumValue
Enum(bpf_kernel) String(4.12) Value(LINUX_V4_12)
EnumValue
Enum(bpf_kernel) String(4.13) Value(LINUX_V4_13)
EnumValue
Enum(bpf_kernel) String(4.14) Value(LINUX_V4_14)
EnumValue
Enum(bpf_kernel) String(4.15) Value(LINUX_V4_15)
EnumValue
Enum(bpf_kernel) String(4.16) Value(LINUX_V4_16)
EnumValue
Enum(bpf_kernel) String(4.17) Value(LINUX_V4_17)
EnumValue
Enum(bpf_kernel) String(4.18) Value(LINUX_V4_18)
EnumValue
Enum(bpf_kernel) String(4.19) Value(LINUX_V4_19)
EnumValue
Enum(bpf_kernel) String(4.20) Value(LINUX_V4_20)
EnumValue
Enum(bpf_kernel) String(5.0) Value(LINUX_V5_0)
EnumValue
Enum(bpf_kernel) String(5.1) Value(LINUX_V5_1)
EnumValue
Enum(bpf_kernel) String(5.2) Value(LINUX_V5_2)
; Selecting big endian or little endian targets.
mbig-endian
Target RejectNegative Report Mask(BIG_ENDIAN)
Generate big-endian eBPF.
mlittle-endian
Target RejectNegative Report InverseMask(BIG_ENDIAN)
Generate little-endian eBPF.
mframe-limit=
Target Joined RejectNegative UInteger IntegerRange(0, 32767) Var(bpf_frame_limit) Init(512)
Set a hard limit for the size of each stack frame, in bytes.
;; Constraint definitions for eBPF.
;; Copyright (C) 2019 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
(define_constraint "I"
"A 32-bit signed immediate."
(and (match_code "const_int")
(match_test "IN_RANGE (ival, -1 - 0x7fffffff, 0x7fffffff)")))
(define_constraint "B"
"A constant argument for LDDW."
(match_code "const,symbol_ref,label_ref,const_double,const_int"))
(define_constraint "S"
"A constant call address."
(match_code "const,symbol_ref,label_ref,const_int"))
;; Predicate definitions for eBPF.
;; Copyright (C) 2019 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
(define_predicate "reg_or_imm_operand"
(ior (and (match_code "const_int")
(match_test "IN_RANGE (INTVAL (op), -1 - 0x7fffffff, 0x7fffffff)"))
(match_operand 0 "register_operand")))
(define_predicate "imm32_operand"
(ior (and (match_code "const_int")
(match_test "IN_RANGE (INTVAL (op), 0, 0xffffffff)"))
(match_code "symbol_ref,label_ref,const")))
(define_predicate "lddw_operand"
(match_code "symbol_ref,label_ref,const,const_double,const_int"))
(define_predicate "call_operand"
(match_code "reg,symbol_ref,const_int,const")
{
if (GET_CODE (op) == CONST)
{
op = XEXP (op, 0);
switch (GET_CODE (op))
{
case SYMBOL_REF:
case LABEL_REF:
case CONST_INT:
return true;
break;
default:
break;
}
return false;
}
return true;
})
(define_predicate "mov_src_operand"
(ior (match_operand 0 "memory_operand")
(match_operand 0 "reg_or_imm_operand")
(match_operand 0 "lddw_operand")))
(define_predicate "register_compare_operator"
(match_code "eq,ne,geu,gtu,ge,gt"))
...@@ -802,6 +802,10 @@ Objective-C and Objective-C++ Dialects}. ...@@ -802,6 +802,10 @@ Objective-C and Objective-C++ Dialects}.
-msmall-text -mlarge-text @gol -msmall-text -mlarge-text @gol
-mmemory-latency=@var{time}} -mmemory-latency=@var{time}}
@emph{eBPF Options}
@gccoptlist{-mbig-endian -mlittle-endian -mkernel=@var{version}
-mframe-limit=@var{bytes}}
@emph{FR30 Options} @emph{FR30 Options}
@gccoptlist{-msmall-model -mno-lsim} @gccoptlist{-msmall-model -mno-lsim}
...@@ -15650,6 +15654,7 @@ platform. ...@@ -15650,6 +15654,7 @@ platform.
* C-SKY Options:: * C-SKY Options::
* Darwin Options:: * Darwin Options::
* DEC Alpha Options:: * DEC Alpha Options::
* eBPF Options::
* FR30 Options:: * FR30 Options::
* FT32 Options:: * FT32 Options::
* FRV Options:: * FRV Options::
...@@ -19771,6 +19776,38 @@ Note that L3 is only valid for EV5. ...@@ -19771,6 +19776,38 @@ Note that L3 is only valid for EV5.
@end table @end table
@end table @end table
@node eBPF Options
@subsection eBPF Options
@cindex eBPF Options
@table @gcctabopt
@item -mframe-limit=@var{bytes}
This specifies the hard limit for frame sizes, in bytes. Currently,
the value that can be specified should be less than or equal to
@samp{32767}. Defaults to whatever limit is imposed by the version of
the Linux kernel targeted.
@item -mkernel=@var{version}
@opindex mkernel
This specifies the minimum version of the kernel that will run the
compiled program. GCC uses this version to determine which
instructions to use, what kernel helpers to allow, etc. Currently,
@var{version} can be one of @samp{4.0}, @samp{4.1}, @samp{4.2},
@samp{4.3}, @samp{4.4}, @samp{4.5}, @samp{4.6}, @samp{4.7},
@samp{4.8}, @samp{4.9}, @samp{4.10}, @samp{4.11}, @samp{4.12},
@samp{4.13}, @samp{4.14}, @samp{4.15}, @samp{4.16}, @samp{4.17},
@samp{4.18}, @samp{4.19}, @samp{4.20}, @samp{5.0}, @samp{5.1},
@samp{5.2}, @samp{latest} and @samp{native}.
@item -mbig-endian
@opindex mbig-endian
Generate code for a big-endian target.
@item -mlittle-endian
@opindex mlittle-endian
Generate code for a little-endian target. This is the default.
@end table
@node FR30 Options @node FR30 Options
@subsection FR30 Options @subsection FR30 Options
@cindex FR30 Options @cindex FR30 Options
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef __SIZE_TYPE__ size_t; typedef __SIZE_TYPE__ size_t;
typedef unsigned char Bufbyte; typedef unsigned char Bufbyte;
typedef int Bytecount; typedef int Bytecount;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
struct utsname { struct utsname {
char sysname[32 ]; char sysname[32 ];
char version[32 ]; char version[32 ];
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
/* { dg-skip-if "No 64-bit registers" { m32c-*-* } } */ /* { dg-skip-if "No 64-bit registers" { m32c-*-* } } */
/* { dg-skip-if "Not enough 64-bit registers" { pdp11-*-* } { "-O0" } { "" } } */ /* { dg-skip-if "Not enough 64-bit registers" { pdp11-*-* } { "-O0" } { "" } } */
/* { dg-xfail-if "Inconsistent constraint on asm" { csky-*-* } { "-O0" } { "" } } */ /* { dg-xfail-if "Inconsistent constraint on asm" { csky-*-* } { "-O0" } { "" } } */
/* { dg-xfail-if "Inconsistent constraint on asm" { bpf-*-* } { "-O0" } { "" } } */
/* { dg-xfail-if "" { h8300-*-* } } */ /* { dg-xfail-if "" { h8300-*-* } } */
/* { dg-require-stack-size "99*4+16" } */ /* { dg-require-stack-size "99*4+16" } */
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
/* { dg-skip-if "too much code for avr" { "avr-*-*" } } */ /* { dg-skip-if "too much code for avr" { "avr-*-*" } } */
/* { dg-skip-if "too much code for pdp11" { "pdp11-*-*" } } */ /* { dg-skip-if "too much code for pdp11" { "pdp11-*-*" } } */
/* { dg-skip-if "" { m32c-*-* } } */ /* { dg-skip-if "" { m32c-*-* } } */
/* { dg-skip-if "jumps too far for eBPF" { bpf-*-* } } */
/* { dg-timeout-factor 4.0 } */ /* { dg-timeout-factor 4.0 } */
/* This testcase exposed two branch shortening bugs on powerpc. */ /* This testcase exposed two branch shortening bugs on powerpc. */
......
/* Derived from PR optimization/11700. */ /* Derived from PR optimization/11700. */
/* The compiler used to ICE during reload for m68k targets. */ /* The compiler used to ICE during reload for m68k targets. */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
void check_complex (__complex__ double, __complex__ double, void check_complex (__complex__ double, __complex__ double,
__complex__ double, __complex__ int); __complex__ double, __complex__ int);
void check_float (double, double, double, int); void check_float (double, double, double, int);
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
short *_offsetTable; short *_offsetTable;
/* This tests to make sure PRE splits the entry block ->block 0 edge /* This tests to make sure PRE splits the entry block ->block 0 edge
when there are multiple block 0 predecessors. when there are multiple block 0 predecessors.
......
/* { dg-skip-if "not enough registers" { pdp11-*-* } } */ /* { dg-skip-if "not enough registers" { pdp11-*-* } } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef struct _ScaleRec *ScaleWidget; typedef struct _ScaleRec *ScaleWidget;
typedef struct typedef struct
{ {
......
/* PR rtl-optimization/16643 */ /* PR rtl-optimization/16643 */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
void foo (int a, int b, int c, int d, int e, int *f) void foo (int a, int b, int c, int d, int e, int *f)
{ {
if (a == 0) if (a == 0)
......
/* PR rtl-optimization/25432 */ /* PR rtl-optimization/25432 */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
void *malloc (__SIZE_TYPE__); void *malloc (__SIZE_TYPE__);
void *realloc (void *, __SIZE_TYPE__); void *realloc (void *, __SIZE_TYPE__);
......
/* Testcase provided by HUAWEI. */ /* Testcase provided by HUAWEI. */
#include <stdio.h>
extern int printf (const char * __format, ...);
int main() int main()
{ {
int cur_k; int cur_k;
......
/* { dg-require-effective-target alloca } */ /* { dg-require-effective-target alloca } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
main () main ()
{ {
char *a; char *a;
......
/* { dg-require-effective-target label_values } */ /* { dg-require-effective-target label_values } */
/* { dg-skip-if "no support for indirect jumps" { bpf-*-* } } */
x(){if(&&e-&&b<0)x();b:goto*&&b;e:;} x(){if(&&e-&&b<0)x();b:goto*&&b;e:;}
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef unsigned long int unsigned_word; typedef unsigned long int unsigned_word;
typedef signed long int signed_word; typedef signed long int signed_word;
typedef unsigned_word word; typedef unsigned_word word;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
double q(double); double q(double);
f (int **x, int *r, int *s, int a, int b, int c, int d) f (int **x, int *r, int *s, int a, int b, int c, int d)
......
/* { dg-require-effective-target untyped_assembly } */ /* { dg-require-effective-target untyped_assembly } */
/* { dg-skip-if "no __builtin_apply in eBPF" { bpf-*-* } } */
g (a, b) {} g (a, b) {}
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
void void
f1 (o1, o2, o3, i, j, k) f1 (o1, o2, o3, i, j, k)
long long *o1, *o2, *o3; long long *o1, *o2, *o3;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef struct _geom_elem { typedef struct _geom_elem {
double coeffs[6]; double coeffs[6];
} pGeomDefRec, *pGeomDefPtr; } pGeomDefRec, *pGeomDefPtr;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef __SIZE_TYPE__ size_t; typedef __SIZE_TYPE__ size_t;
typedef void *XtPointer; typedef void *XtPointer;
......
/* { dg-skip-if "no string.h in eBPF" { bpf-*-* } } */
#define __USE_STRING_INLINES #define __USE_STRING_INLINES
#include <string.h> #include <string.h>
......
/* { dg-require-effective-target int32plus } */ /* { dg-require-effective-target int32plus } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define type double #define type double
type glob0, glob1; type glob0, glob1;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define type short #define type short
type glob0, glob1; type glob0, glob1;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define E0 ((type *)10000000) #define E0 ((type *)10000000)
#define reg0 r0 #define reg0 r0
#define indreg0 (*p0) #define indreg0 (*p0)
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define type signed char #define type signed char
type glob0, glob1; type glob0, glob1;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define E0 ((type *)10000000) #define E0 ((type *)10000000)
#define reg0 r0 #define reg0 r0
#define indreg0 (*p0) #define indreg0 (*p0)
......
/* { dg-require-effective-target int32plus } */ /* { dg-require-effective-target int32plus } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define E0 ((type *)10000000) #define E0 ((type *)10000000)
#define reg0 r0 #define reg0 r0
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define type int #define type int
type glob0, glob1; type glob0, glob1;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define E0 ((type *)10000000) #define E0 ((type *)10000000)
#define reg0 r0 #define reg0 r0
#define indreg0 (*p0) #define indreg0 (*p0)
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define type unsigned short #define type unsigned short
type glob0, glob1; type glob0, glob1;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define type unsigned char #define type unsigned char
type glob0, glob1; type glob0, glob1;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define type unsigned int #define type unsigned int
type glob0, glob1; type glob0, glob1;
......
/* { dg-require-effective-target untyped_assembly } */ /* { dg-require-effective-target untyped_assembly } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
int glob; int glob;
conseq (a, b, c, d) conseq (a, b, c, d)
......
/* { dg-skip-if "too complex for avr" { avr-*-* } } */ /* { dg-skip-if "too complex for avr" { avr-*-* } } */
/* { dg-skip-if "ptxas times out" { nvptx-*-* } } */ /* { dg-skip-if "ptxas times out" { nvptx-*-* } } */
/* { dg-skip-if "no chance for bpf" { bpf-*-* } } */
/* { dg-timeout-factor 4.0 } */ /* { dg-timeout-factor 4.0 } */
#define LIM1(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9, #define LIM1(x) x##0, x##1, x##2, x##3, x##4, x##5, x##6, x##7, x##8, x##9,
#define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ #define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
byte_match_count2 (buf, n, xm, m1, m2, m3, m4) byte_match_count2 (buf, n, xm, m1, m2, m3, m4)
unsigned *buf; unsigned *buf;
......
/* { dg-require-effective-target alloca } */ /* { dg-require-effective-target alloca } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define alloca __builtin_alloca #define alloca __builtin_alloca
x (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x, y) x (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x, y)
......
/* { dg-require-effective-target untyped_assembly } */ /* { dg-require-effective-target untyped_assembly } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
int int
foo (a, b, c) foo (a, b, c)
{ {
......
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
typedef struct typedef struct
{ {
char c[510]; char c[510];
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
foo (a, b, c, d, e, i0, f, i1) foo (a, b, c, d, e, i0, f, i1)
double a, b, c, d, e, f; double a, b, c, d, e, f;
int i0, i1; int i0, i1;
......
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
struct w struct w
{ {
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
void f(unsigned char *src, unsigned char *dst, int num, unsigned char *pos, unsigned char *diffuse, int hasdiffuse, unsigned char *specular, int hasspecular) { void f(unsigned char *src, unsigned char *dst, int num, unsigned char *pos, unsigned char *diffuse, int hasdiffuse, unsigned char *specular, int hasspecular) {
int i; int i;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef unsigned int GLenum; typedef unsigned int GLenum;
typedef unsigned char GLboolean; typedef unsigned char GLboolean;
typedef int GLint; typedef int GLint;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef __SIZE_TYPE__ size_t; typedef __SIZE_TYPE__ size_t;
typedef struct { typedef struct {
} }
......
/* { dg-require-effective-target untyped_assembly } */ /* { dg-require-effective-target untyped_assembly } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef signed char int8_t; typedef signed char int8_t;
typedef short int int16_t; typedef short int int16_t;
typedef int int32_t; typedef int int32_t;
......
/* { dg-require-effective-target untyped_assembly } */ /* { dg-require-effective-target untyped_assembly } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef signed char int8_t; typedef signed char int8_t;
typedef short int int16_t; typedef short int int16_t;
typedef int int32_t; typedef int int32_t;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
extern unsigned int __invalid_size_argument_for_IOC; extern unsigned int __invalid_size_argument_for_IOC;
typedef unsigned int __u32; typedef unsigned int __u32;
struct video_window struct video_window
......
/* PR middle-end/37669 */ /* PR middle-end/37669 */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
#define FMT10 "%d%d%d%d%d%d%d%d%d%d" #define FMT10 "%d%d%d%d%d%d%d%d%d%d"
#define FMT100 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 #define FMT100 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10 FMT10
......
/* This testcase used to fail because a miscompiled execute_fold_all_builtins. */ /* This testcase used to fail because a miscompiled execute_fold_all_builtins. */
/* { dg-options "-fgnu89-inline" } */ /* { dg-options "-fgnu89-inline" } */
/* { dg-require-effective-target int32plus } */ /* { dg-require-effective-target int32plus } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef __SIZE_TYPE__ size_t; typedef __SIZE_TYPE__ size_t;
extern __inline __attribute__ ((__always_inline__)) int __attribute__ extern __inline __attribute__ ((__always_inline__)) int __attribute__
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
void matmul_i4 (int * __restrict dest_y, void matmul_i4 (int * __restrict dest_y,
const int * __restrict abase, const int * __restrict abase,
const int * __restrict bbase_y, const int * __restrict bbase_y,
......
/* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */ /* { dg-options "-msse" { target { i?86-*-* x86_64-*-* } } } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
extern __m128 _mm_sub_ps (__m128 __A, __m128 __B); extern __m128 _mm_sub_ps (__m128 __A, __m128 __B);
extern __m128 _mm_mul_ps (__m128 __A, __m128 __B); extern __m128 _mm_mul_ps (__m128 __A, __m128 __B);
......
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
typedef signed char int8_t; typedef signed char int8_t;
typedef short int16_t; typedef short int16_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
......
/* PR target/48596 */ /* PR target/48596 */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
enum { nrrdCenterUnknown, nrrdCenterNode, nrrdCenterCell, nrrdCenterLast }; enum { nrrdCenterUnknown, nrrdCenterNode, nrrdCenterCell, nrrdCenterLast };
typedef struct { int size; int center; } NrrdAxis; typedef struct { int size; int center; } NrrdAxis;
typedef struct { int dim; NrrdAxis axis[10]; } Nrrd; typedef struct { int dim; NrrdAxis axis[10]; } Nrrd;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
struct B { int b1; long long b2, b3; int b4; }; struct B { int b1; long long b2, b3; int b4; };
struct C { char c1[40], c2, c3[96]; long long c4[5], c5; char c6[596]; }; struct C { char c1[40], c2, c3[96]; long long c4[5], c5; char c6[596]; };
void fn1 (long long), fn2 (char *, int), fn4 (void); void fn1 (long long), fn2 (char *, int), fn4 (void);
......
/* PR c/54428 */ /* PR c/54428 */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef double _Complex C; typedef double _Complex C;
......
/* PR tree-optimization/54713 */ /* PR tree-optimization/54713 */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
#ifndef N #ifndef N
#define N 8 #define N 8
......
/* PR tree-optimization/54713 */ /* PR tree-optimization/54713 */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
#define N 16 #define N 16
#define ONE 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 #define ONE 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
......
/* PR tree-optimization/54713 */ /* PR tree-optimization/54713 */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
#define N 32 #define N 32
#define ONE 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ #define ONE 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
......
/* PR tree-optimization/55921 */ /* PR tree-optimization/55921 */
/* { dg-skip-if "Not enough registers" { "pdp11-*-*" } } */ /* { dg-skip-if "Not enough registers" { "pdp11-*-*" } } */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
typedef union typedef union
{ {
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef int v8si __attribute__ ((vector_size (32))); typedef int v8si __attribute__ ((vector_size (32)));
int int
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef short v16hi __attribute__ ((vector_size (32))); typedef short v16hi __attribute__ ((vector_size (32)));
typedef int v8si __attribute__ ((vector_size (32))); typedef int v8si __attribute__ ((vector_size (32)));
typedef long long v4di __attribute__ ((vector_size (32))); typedef long long v4di __attribute__ ((vector_size (32)));
......
/* { dg-require-effective-target int128 } */ /* { dg-require-effective-target int128 } */
/* { dg-additional-options "-g" } */ /* { dg-additional-options "-g" } */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
typedef unsigned __int128 v2ti __attribute__ ((vector_size (32))); typedef unsigned __int128 v2ti __attribute__ ((vector_size (32)));
......
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef unsigned uint32_t; typedef unsigned uint32_t;
......
/* PR middle-end/83487 */ /* PR middle-end/83487 */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
struct __attribute__ ((aligned)) A {}; struct __attribute__ ((aligned)) A {};
struct A a; struct A a;
......
/* PR middle-end/86122 */ /* PR middle-end/86122 */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
_Complex int _Complex int
foo (_Complex int x) foo (_Complex int x)
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
foo (a, b, c, d, e, f, g, h, i, j, xx) foo (a, b, c, d, e, f, g, h, i, j, xx)
double xx; double xx;
{ {
......
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
int foo; int foo;
typedef long unsigned int size_t; typedef long unsigned int size_t;
typedef short unsigned int wchar_t; typedef short unsigned int wchar_t;
......
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
struct foo struct foo
{ {
int a, b, c, d; int a, b, c, d;
......
/* { dg-require-effective-target untyped_assembly } */ /* { dg-require-effective-target untyped_assembly } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
foo (a, b, c, d, e, f, g, h, i) foo (a, b, c, d, e, f, g, h, i)
{ {
return foo () + i; return foo () + i;
......
/* { dg-do compile { target fpic } } */ /* { dg-do compile { target fpic } } */
/* { dg-options "-O2 -fpic" } */ /* { dg-options "-O2 -fpic" } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
extern void foo (void *a, double x, double y); extern void foo (void *a, double x, double y);
void void
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2" } */ /* { dg-options "-O2" } */
/* { dg-options "-O2 -msse -ffast-math" { target i?86-*-* x86_64-*-* } } */ /* { dg-options "-O2 -msse -ffast-math" { target i?86-*-* x86_64-*-* } } */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
void bar (float *a, float *b); void bar (float *a, float *b);
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2" } */ /* { dg-options "-O2" } */
/* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && { ia32 && fpic } } } } */ /* { dg-options "-O2 -frename-registers -fomit-frame-pointer -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && { ia32 && fpic } } } } */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
extern void exit (int); extern void exit (int);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
/* { dg-do compile { target fpic } } */ /* { dg-do compile { target fpic } } */
/* { dg-options "-O2 -frename-registers -fpic" } */ /* { dg-options "-O2 -frename-registers -fpic" } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef unsigned long XID; typedef unsigned long XID;
typedef XID Window; typedef XID Window;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2" } */ /* { dg-options "-O2" } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
typedef struct test typedef struct test
{ {
......
/* { dg-do link } */ /* { dg-do link } */
/* { dg-require-effective-target ptr32plus } */ /* { dg-require-effective-target ptr32plus } */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
/* This validates codegen for [r1+32760] on Darwin. */ /* This validates codegen for [r1+32760] on Darwin. */
void f(char x[32688], double *y, double *z) __attribute__((noinline)); void f(char x[32688], double *y, double *z) __attribute__((noinline));
void f(char x[32688], double *y, double *z) {} void f(char x[32688], double *y, double *z) {}
......
/* { dg-do run } */ /* { dg-do run } */
/* { dg-options "-O2" } */ /* { dg-options "-O2" } */
/* { dg-skip-if "no stdlib.h in eBPF" { bpf-*-* } } */
#include <stdlib.h> #include <stdlib.h>
struct s { struct s {
unsigned short f: 16; unsigned short f: 16;
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -w" } */ /* { dg-options "-O2 -w" } */
/* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
/* This file was automatically reduced from tree-ssa-operands.c. It /* This file was automatically reduced from tree-ssa-operands.c. It
contains many warnings, but it exposes a copy propagation bug that contains many warnings, but it exposes a copy propagation bug that
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O1" } */ /* { dg-options "-O1" } */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
/* This testcase failed on s390. The frame size for function f will be /* This testcase failed on s390. The frame size for function f will be
exactly 32768 bytes. The back end has to recognize that this is to exactly 32768 bytes. The back end has to recognize that this is to
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -Warray-bounds" } */ /* { dg-options "-O2 -Warray-bounds" } */
/* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
/* based on PR 31227 */ /* based on PR 31227 */
typedef __SIZE_TYPE__ size_t; typedef __SIZE_TYPE__ size_t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment