From 38a8aecfb882072900434499696b5c32a2274515 Mon Sep 17 00:00:00 2001 From: Rong Xu Date: Mon, 21 Jul 2014 16:47:22 -0700 Subject: [4.9] Switch gcc-4.9 to use google/gcc-4_9 branch. This source drop uses svn version r212828 of google/gcc-4.9 branch. We also cherry-picked r213062, r213063 and r213064 to fix windows build issues. All gcc-4.9 patches before July 3rd are ported to google/gcc-4.9. The following prior commits has not been merged to google branch yet. (They are included in this commit). e7af147f979e657fe2df00808e5b4319b0e088c6, baf87df3cb2683649ba7e9872362a7e721117c23, and c231900e5dcc14d8296bd9f62b45997a49d4d5e7. Change-Id: I4bea3ea470387ff751c2be4cb0d4a12059b9299b --- gcc-4.9/gcc/testsuite/ChangeLog | 582 ++ gcc-4.9/gcc/testsuite/ChangeLog-2013 | 3197 +++++++++++ gcc-4.9/gcc/testsuite/ada/.gitignore | 2 + .../c-c++-common/cilk-plus/AN/pr57541-2.c | 15 + .../testsuite/c-c++-common/cilk-plus/AN/pr57541.c | 13 +- .../testsuite/c-c++-common/cilk-plus/AN/pr58942.c | 8 + .../testsuite/c-c++-common/cilk-plus/AN/pr61191.c | 10 + .../c-c++-common/cilk-plus/CK/invalid_sync.cc | 9 + gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr59073.c | 12 + .../gcc/testsuite/c-c++-common/gomp/pr60823-1.c | 19 + .../gcc/testsuite/c-c++-common/gomp/pr60823-2.c | 44 + .../gcc/testsuite/c-c++-common/gomp/pr60823-3.c | 32 + .../gcc/testsuite/c-c++-common/gomp/pr61486-1.c | 13 + .../gcc/testsuite/c-c++-common/gomp/pr61486-2.c | 458 ++ .../gcc/testsuite/c-c++-common/torture/pr60971.c | 34 + .../gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C | 17 + .../gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem2.C | 13 + .../testsuite/g++.dg/cpp0x/constexpr-template7.C | 32 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted49.C | 15 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist84.C | 17 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist86.C | 18 + .../testsuite/g++.dg/cpp0x/lambda/lambda-const3.C | 38 + .../g++.dg/cpp0x/lambda/lambda-template13.C | 20 + .../testsuite/g++.dg/cpp0x/lambda/lambda-this18.C | 30 + .../gcc/testsuite/g++.dg/cpp0x/nsdmi-template10.C | 14 + .../gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C | 15 + .../gcc/testsuite/g++.dg/cpp0x/nsdmi-template12.C | 17 + .../gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C | 11 + .../gcc/testsuite/g++.dg/cpp0x/nsdmi-template9.C | 16 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58155.C | 13 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58781.C | 18 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr60249.C | 6 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual15.C | 13 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae50.C | 41 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic158.C | 24 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic159.C | 14 + gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic160.C | 49 + gcc-4.9/gcc/testsuite/g++.dg/cpp1y/pr59867.C | 52 + .../gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C | 2 +- .../testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C | 55 + .../testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C | 2 +- .../g++.dg/debug/dwarf2/imported-decl-2.C | 32 + .../gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C | 23 + gcc-4.9/gcc/testsuite/g++.dg/eh/spec3-static.C | 25 - gcc-4.9/gcc/testsuite/g++.dg/ext/complit14.C | 11 + gcc-4.9/gcc/testsuite/g++.dg/gcov/gcov-7.C | 28 - gcc-4.9/gcc/testsuite/g++.dg/guality/guality.exp | 3 + gcc-4.9/gcc/testsuite/g++.dg/init/copy7.C | 9 + gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-11.C | 4 +- gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-25.C | 2 +- gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-31.C | 23 + gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-9.C | 2 +- gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60600.C | 4 +- gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61085.C | 33 + gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C | 31 + gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C | 43 + gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-3.C | 37 + gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61540.C | 38 + gcc-4.9/gcc/testsuite/g++.dg/opt/pr60849.C | 13 + gcc-4.9/gcc/testsuite/g++.dg/opt/pr60912.C | 18 + gcc-4.9/gcc/testsuite/g++.dg/opt/pr61456.C | 26 + gcc-4.9/gcc/testsuite/g++.dg/opt/pr61654.C | 27 + gcc-4.9/gcc/testsuite/g++.dg/opt/typeinfo1.C | 27 + .../g++.dg/other/no-strict-enum-precision-1.C | 35 + .../g++.dg/other/no-strict-enum-precision-2.C | 37 + .../g++.dg/other/no-strict-enum-precision-3.C | 21 + .../gcc/testsuite/g++.dg/other/sized-delete-1.C | 14 + gcc-4.9/gcc/testsuite/g++.dg/plugin/selfassign.c | 4 +- gcc-4.9/gcc/testsuite/g++.dg/pr60969.C | 32 + gcc-4.9/gcc/testsuite/g++.dg/pr61094.C | 31 + gcc-4.9/gcc/testsuite/g++.dg/pr61289-2.c | 62 + gcc-4.9/gcc/testsuite/g++.dg/pr61289.C | 63 + gcc-4.9/gcc/testsuite/g++.dg/rtti/repo1.C | 1 + gcc-4.9/gcc/testsuite/g++.dg/template/conv14.C | 30 + gcc-4.9/gcc/testsuite/g++.dg/template/local-fn1.C | 8 + gcc-4.9/gcc/testsuite/g++.dg/template/pr61537.C | 23 + gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem27.C | 22 + gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem28.C | 10 + gcc-4.9/gcc/testsuite/g++.dg/thunk_section_name.C | 30 + gcc-4.9/gcc/testsuite/g++.dg/tls/thread_local9.C | 23 + gcc-4.9/gcc/testsuite/g++.dg/torture/pr60854.C | 13 + gcc-4.9/gcc/testsuite/g++.dg/torture/pr60895.C | 32 + .../g++.dg/tree-prof/func_reorder_gold_plugin_1.C | 45 + .../g++.dg/tree-prof/func_reorder_gold_plugin_2.C | 25 + .../g++.dg/tree-prof/func_reorder_gold_plugin_3.C | 25 + .../g++.dg/tree-prof/func_reorder_gold_plugin_4.C | 41 + .../g++.dg/tree-prof/func_reorder_gold_plugin_5.C | 41 + .../g++.dg/tree-prof/func_reorder_gold_plugin_6.C | 53 + .../g++.dg/tree-prof/func_reorder_gold_plugin_7.C | 55 + .../g++.dg/tree-prof/func_reorder_gold_plugin_8.C | 19 + .../func_reorder_gold_plugin_split_functions_1.C | 63 + .../g++.dg/tree-prof/lipo/indir-call-prof-2_0.C | 35 + .../g++.dg/tree-prof/lipo/indir-call-prof_0.C | 39 + .../g++.dg/tree-prof/lipo/inline_mismatch_args_0.C | 36 + .../gcc/testsuite/g++.dg/tree-prof/lipo/lipo.exp | 60 + .../testsuite/g++.dg/tree-prof/lipo/partition1_0.C | 54 + .../testsuite/g++.dg/tree-prof/lipo/partition2_0.C | 16 + .../testsuite/g++.dg/tree-prof/lipo/partition3_0.C | 18 + .../gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_0.C | 41 + .../gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_1.C | 23 + .../gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_2.C | 31 + gcc-4.9/gcc/testsuite/g++.dg/tree-prof/morefunc.C | 55 + gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder.C | 48 + .../testsuite/g++.dg/tree-prof/reorder_class1.h | 11 + .../testsuite/g++.dg/tree-prof/reorder_class2.h | 12 + .../gcc/testsuite/g++.dg/tree-prof/tree-prof.exp | 4 +- .../testsuite/g++.dg/tree-ssa/forwprop-switch.C | 24 + gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr61009.C | 53 + gcc-4.9/gcc/testsuite/g++.dg/vect/pr60836.cc | 39 + gcc-4.9/gcc/testsuite/g++.dg/warn/Weff1.C | 5 - .../gcc/testsuite/g++.dg/warn/Wnull-conversion-1.C | 2 +- .../gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C | 58 +- gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-1.C | 54 + gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-3.C | 35 + gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-4.C | 48 + gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-5.C | 38 + .../testsuite/g++.dg/warn/Wself-assign-non-pod-1.C | 54 + .../testsuite/g++.dg/warn/Wself-assign-non-pod-3.C | 35 + .../testsuite/g++.dg/warn/Wself-assign-non-pod-4.C | 48 + .../testsuite/g++.dg/warn/Wself-assign-non-pod-5.C | 38 + .../g++.dg/warn/Wshadow-compatible-local-1.C | 63 + .../gcc/testsuite/g++.dg/warn/Wshadow-local-1.C | 35 + .../gcc/testsuite/g++.dg/warn/Wshadow-local-2.C | 63 + .../testsuite/g++.old-deja/g++.benjamin/15309-1.C | 21 - .../testsuite/g++.old-deja/g++.benjamin/15309-2.C | 10 - .../gcc/testsuite/g++.old-deja/g++.ext/memconst.C | 2 +- .../gcc/testsuite/gcc.c-torture/compile/pr61684.c | 15 + .../testsuite/gcc.c-torture/execute/20140425-1.c | 23 + .../gcc/testsuite/gcc.c-torture/execute/pr60960.c | 38 + .../testsuite/gcc.c-torture/execute/pr61306-1.c | 39 + .../testsuite/gcc.c-torture/execute/pr61306-2.c | 40 + .../testsuite/gcc.c-torture/execute/pr61306-3.c | 13 + .../gcc/testsuite/gcc.c-torture/execute/pr61673.c | 50 + .../gcc/testsuite/gcc.c-torture/execute/pr61725.c | 14 + .../testsuite/gcc.dg/Wshadow-compatible-local-1.c | 36 + gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-1.c | 23 + gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-2.c | 49 + gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-3.c | 9 + gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-1.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-3.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-4.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-5.c | 2 +- .../testsuite/gcc.dg/autopar/parallelization-1.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1char.c | 2 +- .../gcc/testsuite/gcc.dg/autopar/reduc-1short.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2char.c | 2 +- .../gcc/testsuite/gcc.dg/autopar/reduc-2short.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-3.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-6.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-7.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-8.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-9.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt1.c | 32 + gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt2.c | 31 + .../gcc/testsuite/gcc.dg/fstack-protector-strong.c | 5 +- gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr55022.c | 27 + gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-1.c | 16 + gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-2.c | 15 + gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr60979.c | 37 + gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.exp | 3 + gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_0.c | 15 + gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_1.c | 1 + gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60911_0.c | 21 + gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_0.c | 6 + gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_1.c | 2 + gcc-4.9/gcc/testsuite/gcc.dg/plugin/selfassign.c | 4 +- gcc-4.9/gcc/testsuite/gcc.dg/pr47793.c | 1 - gcc-4.9/gcc/testsuite/gcc.dg/pr53265.c | 4 +- gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c | 171 + gcc-4.9/gcc/testsuite/gcc.dg/pr60844.c | 16 + gcc-4.9/gcc/testsuite/gcc.dg/pr60866.c | 18 + gcc-4.9/gcc/testsuite/gcc.dg/pr61045.c | 12 + gcc-4.9/gcc/testsuite/gcc.dg/pr61053.c | 75 + gcc-4.9/gcc/testsuite/gcc.dg/pr61060.c | 19 + gcc-4.9/gcc/testsuite/gcc.dg/pr61158.c | 12 + gcc-4.9/gcc/testsuite/gcc.dg/pr61583.c | 18 + .../gcc.dg/record-compilation-info-in-elf-1.c | 16 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c | 32 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-2.c | 34 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c | 37 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60891.c | 23 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60903.c | 22 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60930.c | 22 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61010.c | 8 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61383-1.c | 35 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61452.c | 31 + gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61681.c | 37 + .../gcc.dg/tree-prof/crossmodule-indircall-1a.c | 1 + gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c | 4 +- .../testsuite/gcc.dg/tree-prof/lipo/bb-reorg_0.c | 39 + .../gcc.dg/tree-prof/lipo/ic-misattribution-1_0.c | 19 + .../gcc.dg/tree-prof/lipo/ic-misattribution-1_1.c | 18 + .../tree-prof/lipo/indir-call-prof-single_0.c | 43 + .../gcc.dg/tree-prof/lipo/indir-call-prof_0.c | 23 + .../gcc.dg/tree-prof/lipo/indir-call-prof_1.c | 23 + .../testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c | 42 + .../gcc/testsuite/gcc.dg/tree-prof/lipo/lipo.exp | 60 + .../gcc.dg/tree-prof/lipo/lipo_inline1_0.c | 29 + .../gcc.dg/tree-prof/lipo/lipo_inline1_1.c | 22 + .../gcc.dg/tree-prof/lipo/lipo_inline1_2.c | 6 + .../testsuite/gcc.dg/tree-prof/lipo/pr34999_0.c | 45 + .../testsuite/gcc.dg/tree-prof/lipo/pr45354_0.c | 43 + .../testsuite/gcc.dg/tree-prof/lipo/pr47187_0.c | 23 + .../testsuite/gcc.dg/tree-prof/lipo/stringop-1_0.c | 22 + .../testsuite/gcc.dg/tree-prof/lipo/stringop-2_0.c | 20 + .../testsuite/gcc.dg/tree-prof/lipo/tracer-1_0.c | 18 + .../gcc.dg/tree-prof/lipo/update-cunroll-2_0.c | 21 + .../gcc.dg/tree-prof/lipo/update-loopch_0.c | 20 + .../gcc.dg/tree-prof/lipo/update-tailcall_0.c | 20 + .../testsuite/gcc.dg/tree-prof/lipo/val-prof-1_0.c | 22 + .../testsuite/gcc.dg/tree-prof/lipo/val-prof-2_0.c | 32 + .../testsuite/gcc.dg/tree-prof/lipo/val-prof-3_0.c | 32 + .../testsuite/gcc.dg/tree-prof/lipo/val-prof-4_0.c | 32 + .../testsuite/gcc.dg/tree-prof/lipo/val-prof-5_0.c | 17 + .../testsuite/gcc.dg/tree-prof/lipo/val-prof-6_0.c | 20 + .../testsuite/gcc.dg/tree-prof/lipo/val-prof-7_0.c | 26 + .../gcc.dg/tree-prof/lipo/wcoverage-mismatch_0.c | 20 + .../gcc/testsuite/gcc.dg/tree-prof/merge_block.c | 21 + gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_1.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_2.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_4.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-16.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp93.c | 36 + gcc-4.9/gcc/testsuite/gcc.dg/typeof-2.c | 28 + gcc-4.9/gcc/testsuite/gcc.dg/unused-8b.c | 4 + gcc-4.9/gcc/testsuite/gcc.dg/var-expand1.c | 2 +- gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60841.c | 183 + gcc-4.9/gcc/testsuite/gcc.dg/vect/pr61680.c | 51 + gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-sad.c | 54 + .../gcc/testsuite/gcc.dg/vect/vect-singleton_1.c | 38 + gcc-4.9/gcc/testsuite/gcc.dg/vect/vect.exp | 25 +- gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-1.c | 27 + gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-2.c | 24 + gcc-4.9/gcc/testsuite/gcc.misc-tests/help.exp | 2 +- .../gcc.target/aarch64/aapcs64/type-def.h | 7 + .../gcc.target/aarch64/aapcs64/va_arg-13.c | 59 + .../gcc.target/aarch64/aapcs64/va_arg-14.c | 35 + .../gcc.target/aarch64/aapcs64/va_arg-15.c | 39 + gcc-4.9/gcc/testsuite/gcc.target/aarch64/pr61325.c | 19 + .../gcc.target/aarch64/scalar_intrinsics.c | 26 +- .../gcc.target/aarch64/vector_intrinsics.c | 14 +- .../gcc.target/aarch64/vqdmlal_high_lane_s16.c | 15 + .../gcc.target/aarch64/vqdmlal_high_lane_s32.c | 15 + .../gcc.target/aarch64/vqdmlal_high_laneq_s16.c | 15 + .../gcc.target/aarch64/vqdmlal_high_laneq_s32.c | 15 + .../gcc.target/aarch64/vqdmlal_lane_s16.c | 15 + .../gcc.target/aarch64/vqdmlal_lane_s32.c | 15 + .../gcc.target/aarch64/vqdmlal_laneq_s16.c | 15 + .../gcc.target/aarch64/vqdmlal_laneq_s32.c | 15 + .../gcc.target/aarch64/vqdmlalh_lane_s16.c | 15 + .../gcc.target/aarch64/vqdmlals_lane_s32.c | 15 + .../gcc.target/aarch64/vqdmlsl_high_lane_s16.c | 15 + .../gcc.target/aarch64/vqdmlsl_high_lane_s32.c | 15 + .../gcc.target/aarch64/vqdmlsl_high_laneq_s16.c | 15 + .../gcc.target/aarch64/vqdmlsl_high_laneq_s32.c | 15 + .../gcc.target/aarch64/vqdmlsl_lane_s16.c | 15 + .../gcc.target/aarch64/vqdmlsl_lane_s32.c | 15 + .../gcc.target/aarch64/vqdmlsl_laneq_s32.c | 15 + .../gcc.target/aarch64/vqdmlslh_lane_s16.c | 15 + .../gcc.target/aarch64/vqdmlsls_lane_s32.c | 15 + .../gcc.target/aarch64/vqdmulh_laneq_s16.c | 15 + .../gcc.target/aarch64/vqdmulh_laneq_s32.c | 15 + .../gcc.target/aarch64/vqdmulhh_lane_s16.c | 36 + .../gcc.target/aarch64/vqdmulhq_laneq_s16.c | 15 + .../gcc.target/aarch64/vqdmulhq_laneq_s32.c | 15 + .../gcc.target/aarch64/vqdmulhs_lane_s32.c | 34 + .../gcc.target/aarch64/vqdmull_high_lane_s16.c | 15 + .../gcc.target/aarch64/vqdmull_high_lane_s32.c | 15 + .../gcc.target/aarch64/vqdmull_high_laneq_s16.c | 15 + .../gcc.target/aarch64/vqdmull_high_laneq_s32.c | 15 + .../gcc.target/aarch64/vqdmull_lane_s16.c | 15 + .../gcc.target/aarch64/vqdmull_lane_s32.c | 15 + .../gcc.target/aarch64/vqdmull_laneq_s16.c | 15 + .../gcc.target/aarch64/vqdmull_laneq_s32.c | 15 + .../gcc.target/aarch64/vqdmullh_lane_s16.c | 15 + .../gcc.target/aarch64/vqdmulls_lane_s32.c | 15 + .../gcc.target/aarch64/vqrdmulh_laneq_s16.c | 15 + .../gcc.target/aarch64/vqrdmulh_laneq_s32.c | 15 + .../gcc.target/aarch64/vqrdmulhh_lane_s16.c | 35 + .../gcc.target/aarch64/vqrdmulhq_laneq_s16.c | 15 + .../gcc.target/aarch64/vqrdmulhq_laneq_s32.c | 15 + .../gcc.target/aarch64/vqrdmulhs_lane_s32.c | 35 + gcc-4.9/gcc/testsuite/gcc.target/alpha/pr61586.c | 10 + gcc-4.9/gcc/testsuite/gcc.target/arm/pr48252.c | 13 +- gcc-4.9/gcc/testsuite/gcc.target/avr/pr60991.c | 21 + .../gcc/testsuite/gcc.target/avr/torture/pr61055.c | 88 + .../gcc/testsuite/gcc.target/avr/torture/pr61443.c | 134 + .../gcc/testsuite/gcc.target/i386/avx-pr57233.c | 16 + .../gcc/testsuite/gcc.target/i386/avx2-pr57233.c | 16 + .../gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c | 2 +- .../gcc/testsuite/gcc.target/i386/avx2-vpaddw-3.c | 2 +- .../gcc/testsuite/gcc.target/i386/avx2-vpmullw-3.c | 2 +- .../gcc/testsuite/gcc.target/i386/avx2-vpsraw-3.c | 2 +- .../gcc/testsuite/gcc.target/i386/avx2-vpsrlw-3.c | 2 +- .../gcc/testsuite/gcc.target/i386/avx2-vpsubb-3.c | 2 +- .../gcc/testsuite/gcc.target/i386/avx2-vpsubw-3.c | 2 +- .../testsuite/gcc.target/i386/avx512f-pr57233.c | 16 + .../gcc/testsuite/gcc.target/i386/bmi-andn-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-andn-2a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-bextr-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-bextr-2a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-blsi-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-blsi-2a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-blsmsk-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-blsmsk-2a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-blsr-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-blsr-2a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-tzcnt-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi-tzcnt-2a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi2-bzhi32-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi2-bzhi64-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi2-pdep32-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi2-pdep64-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi2-pext32-1a.c | 2 +- .../gcc/testsuite/gcc.target/i386/bmi2-pext64-1a.c | 2 +- gcc-4.9/gcc/testsuite/gcc.target/i386/cadd.c | 2 +- gcc-4.9/gcc/testsuite/gcc.target/i386/clearcap.map | 3 - .../gcc/testsuite/gcc.target/i386/clearcapv2.map | 7 - gcc-4.9/gcc/testsuite/gcc.target/i386/i386.exp | 36 +- .../testsuite/gcc.target/i386/patch-functions-1.c | 23 + .../testsuite/gcc.target/i386/patch-functions-2.c | 21 + .../testsuite/gcc.target/i386/patch-functions-3.c | 21 + .../testsuite/gcc.target/i386/patch-functions-4.c | 22 + .../testsuite/gcc.target/i386/patch-functions-5.c | 22 + .../testsuite/gcc.target/i386/patch-functions-6.c | 15 + .../testsuite/gcc.target/i386/patch-functions-7.c | 15 + .../testsuite/gcc.target/i386/patch-functions-8.c | 29 + .../i386/patch-functions-force-no-patching.c | 27 + .../i386/patch-functions-force-patching.c | 20 + .../gcc.target/i386/patch-functions-sibling-call.c | 26 + .../testsuite/gcc.target/i386/pie-copyrelocs-1.c | 13 + .../testsuite/gcc.target/i386/pie-copyrelocs-2.c | 13 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr50038.c | 2 +- gcc-4.9/gcc/testsuite/gcc.target/i386/pr57233.c | 15 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr60868.c | 10 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr60901.c | 17 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c | 32 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-1.c | 11 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-2.c | 11 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr61423.c | 38 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr61446.c | 14 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-1.c | 13 + gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-2.c | 13 + .../gcc.target/i386/recip-vec-sqrtf-avx.c | 2 +- .../gcc/testsuite/gcc.target/i386/sse2-pr57233.c | 16 + .../testsuite/gcc.target/i386/sse2-unaligned-mov.c | 20 + .../testsuite/gcc.target/i386/sse4_1-roundss-1.c | 2 +- .../testsuite/gcc.target/i386/sse4_1-roundss-2.c | 2 +- .../testsuite/gcc.target/i386/sse4_1-roundss-3.c | 2 +- .../gcc/testsuite/gcc.target/i386/vec-may_alias.c | 25 + gcc-4.9/gcc/testsuite/gcc.target/i386/wmul-1.c | 2 +- .../gcc/testsuite/gcc.target/i386/xop-pr57233.c | 16 + gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-1.c | 27 + gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-2.c | 44 + gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-3.c | 103 + .../testsuite/gcc.target/powerpc/dfp-builtin-1.c | 88 + .../testsuite/gcc.target/powerpc/dfp-builtin-2.c | 88 + .../testsuite/gcc.target/powerpc/extend-divide-1.c | 34 + .../testsuite/gcc.target/powerpc/extend-divide-2.c | 34 + .../gcc/testsuite/gcc.target/powerpc/htm-ttest.c | 14 + gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack01.c | 91 + gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack02.c | 96 + gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack03.c | 88 + gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr60735.c | 11 + .../gcc/testsuite/gcc.target/powerpc/tfmode_off.c | 1 + .../gcc/testsuite/gcc.target/powerpc/ti_math1.c | 20 + .../gcc/testsuite/gcc.target/powerpc/ti_math2.c | 73 + .../gcc/testsuite/gcc.target/s390/htm-nofloat-2.c | 55 - .../gcc.target/x86_64/abi/avx/abi-avx.exp | 16 +- .../gcc.target/x86_64/abi/avx512f/abi-avx512f.exp | 16 +- .../gcc.target/x86_64/abi/callabi/leaf-2.c | 2 +- .../gfortran.dg/allocatable_function_8.f90 | 59 + gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_14.f90 | 18 + gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_15.f90 | 11 + gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_16.f90 | 13 + gcc-4.9/gcc/testsuite/gfortran.dg/associate_16.f90 | 23 + gcc-4.9/gcc/testsuite/gfortran.dg/associate_17.f90 | 12 + .../gcc/testsuite/gfortran.dg/class_array_15.f03 | 3 + .../gcc/testsuite/gfortran.dg/cray_pointers_10.f90 | 18 + .../gfortran.dg/default_format_denormal_2.f90 | 4 +- gcc-4.9/gcc/testsuite/gfortran.dg/finalize_25.f90 | 55 + .../gcc/testsuite/gfortran.dg/gomp/affinity-1.f90 | 19 + .../gfortran.dg/gomp/allocatable_components_1.f90 | 10 +- .../gfortran.dg/gomp/appendix-a/a.31.3.f90 | 2 +- .../gcc/testsuite/gfortran.dg/gomp/associate1.f90 | 83 + .../testsuite/gfortran.dg/gomp/declare-simd-1.f90 | 9 + .../gcc/testsuite/gfortran.dg/gomp/depend-1.f90 | 13 + .../gcc/testsuite/gfortran.dg/gomp/intentin1.f90 | 16 + .../gfortran.dg/gomp/omp_do_concurrent.f90 | 13 + .../testsuite/gfortran.dg/gomp/openmp-simd-1.f90 | 137 + .../testsuite/gfortran.dg/gomp/openmp-simd-2.f90 | 28 + .../testsuite/gfortran.dg/gomp/openmp-simd-3.f90 | 28 + .../gcc/testsuite/gfortran.dg/gomp/proc_ptr_2.f90 | 14 + .../gcc/testsuite/gfortran.dg/gomp/reduction1.f90 | 68 +- .../gcc/testsuite/gfortran.dg/gomp/reduction3.f90 | 8 +- gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target1.f90 | 520 ++ gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target2.f90 | 74 + gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target3.f90 | 12 + gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr1.f90 | 41 + gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr2.f90 | 53 + gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr3.f90 | 75 + gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr4.f90 | 74 + gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr5.f90 | 59 + gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr6.f90 | 205 + gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr7.f90 | 90 + gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr8.f90 | 351 ++ .../gcc/testsuite/gfortran.dg/graphite/pr59817.f | 14 + .../gcc/testsuite/gfortran.dg/guality/guality.exp | 3 + gcc-4.9/gcc/testsuite/gfortran.dg/list_read_13.f | 13 + gcc-4.9/gcc/testsuite/gfortran.dg/nint_2.f90 | 3 +- gcc-4.9/gcc/testsuite/gfortran.dg/oldstyle_5.f | 8 + .../gcc/testsuite/gfortran.dg/openmp-define-3.f90 | 2 +- gcc-4.9/gcc/testsuite/gfortran.dg/round_4.f90 | 1 + gcc-4.9/gcc/testsuite/gnat.dg/aliasing1.adb | 2 +- gcc-4.9/gcc/testsuite/gnat.dg/enum3.adb | 23 + gcc-4.9/gcc/testsuite/gnat.dg/opt38.adb | 9 + gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.adb | 33 + gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.ads | 5 + gcc-4.9/gcc/testsuite/gnat.dg/opt39.adb | 31 + gcc-4.9/gcc/testsuite/gnat.dg/overflow_fixed.adb | 19 + gcc-4.9/gcc/testsuite/lib/asan-dg.exp | 6 +- gcc-4.9/gcc/testsuite/lib/clearcap.exp | 58 + gcc-4.9/gcc/testsuite/lib/gcov.exp | 2 + gcc-4.9/gcc/testsuite/lib/profopt.exp | 76 +- gcc-4.9/gcc/testsuite/lib/target-supports-dg.exp | 19 + gcc-4.9/gcc/testsuite/lib/target-supports.exp | 53 + gcc-4.9/gcc/testsuite/lib/target-supports.exp.orig | 5791 -------------------- gcc-4.9/gcc/testsuite/lib/ubsan-dg.exp | 6 +- 437 files changed, 14951 insertions(+), 6234 deletions(-) create mode 100644 gcc-4.9/gcc/testsuite/ada/.gitignore create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541-2.c create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr58942.c create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_sync.cc create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr59073.c create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-1.c create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-2.c create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-3.c create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr61486-1.c create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr61486-2.c create mode 100644 gcc-4.9/gcc/testsuite/c-c++-common/torture/pr60971.c create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem2.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template7.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted49.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist84.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist86.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const3.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template13.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this18.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template10.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template12.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template9.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58155.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58781.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr60249.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual15.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae50.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic158.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic159.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic160.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/cpp1y/pr59867.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C delete mode 100644 gcc-4.9/gcc/testsuite/g++.dg/eh/spec3-static.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/ext/complit14.C delete mode 100644 gcc-4.9/gcc/testsuite/g++.dg/gcov/gcov-7.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/init/copy7.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-31.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61085.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-3.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61540.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/opt/pr60849.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/opt/pr60912.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/opt/pr61456.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/opt/pr61654.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/opt/typeinfo1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-2.C create mode 100755 gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-3.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/other/sized-delete-1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/pr60969.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/pr61094.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/pr61289-2.c create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/pr61289.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/template/conv14.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/template/local-fn1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/template/pr61537.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem27.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem28.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/thunk_section_name.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tls/thread_local9.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/torture/pr60854.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/torture/pr60895.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_2.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_4.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_5.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_6.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_7.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_split_functions_1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/indir-call-prof-2_0.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/indir-call-prof_0.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/lipo.exp create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition1_0.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition2_0.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition3_0.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_0.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_2.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/morefunc.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder_class1.h create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder_class2.h create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/forwprop-switch.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr61009.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/vect/pr60836.cc delete mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Weff1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-3.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-4.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-5.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-3.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-4.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-5.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-compatible-local-1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-local-1.C create mode 100644 gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-local-2.C delete mode 100644 gcc-4.9/gcc/testsuite/g++.old-deja/g++.benjamin/15309-1.C delete mode 100644 gcc-4.9/gcc/testsuite/g++.old-deja/g++.benjamin/15309-2.C create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr61684.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20140425-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr60960.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61673.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61725.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-compatible-local-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-3.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr55022.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr60979.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60911_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/pr60844.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/pr60866.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/pr61045.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/pr61053.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/pr61060.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/pr61158.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/pr61583.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/record-compilation-info-in-elf-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60891.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60903.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60930.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61010.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61383-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61452.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61681.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/bb-reorg_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/ic-misattribution-1_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/ic-misattribution-1_1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof-single_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof_1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo.exp create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr34999_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr45354_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr47187_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/stringop-1_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/stringop-2_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/tracer-1_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/update-cunroll-2_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/update-loopch_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/update-tailcall_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-1_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-2_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-3_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-4_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-5_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-6_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-7_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/wcoverage-mismatch_0.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/merge_block.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp93.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/typeof-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/unused-8b.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60841.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/vect/pr61680.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-sad.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-singleton_1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/pr61325.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_laneq_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_laneq_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlalh_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlals_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_laneq_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlslh_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsls_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulh_laneq_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulh_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhh_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhq_laneq_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhq_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhs_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_laneq_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_laneq_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmullh_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulls_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulh_laneq_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulh_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhh_lane_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhq_laneq_s16.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhq_laneq_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhs_lane_s32.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/alpha/pr61586.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/avr/pr60991.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/avr/torture/pr61055.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/avr/torture/pr61443.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/avx-pr57233.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-pr57233.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-pr57233.c delete mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/clearcap.map delete mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/clearcapv2.map create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-3.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-4.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-5.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-6.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-7.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-8.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-force-no-patching.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-force-patching.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-sibling-call.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr57233.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr60868.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr60901.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr61423.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr61446.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/sse2-pr57233.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/sse2-unaligned-mov.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/vec-may_alias.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/xop-pr57233.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-3.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/dfp-builtin-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/dfp-builtin-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/extend-divide-1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/extend-divide-2.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/htm-ttest.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack01.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack02.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack03.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr60735.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/ti_math1.c create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/powerpc/ti_math2.c delete mode 100644 gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-2.c create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_14.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_15.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_16.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/associate_16.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/associate_17.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/finalize_25.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/affinity-1.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/associate1.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/declare-simd-1.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/depend-1.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/intentin1.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/omp_do_concurrent.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-1.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-2.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-3.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/proc_ptr_2.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target1.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target2.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target3.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr1.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr2.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr3.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr4.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr5.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr6.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr7.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr8.f90 create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/graphite/pr59817.f create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/list_read_13.f create mode 100644 gcc-4.9/gcc/testsuite/gfortran.dg/oldstyle_5.f create mode 100644 gcc-4.9/gcc/testsuite/gnat.dg/enum3.adb create mode 100644 gcc-4.9/gcc/testsuite/gnat.dg/opt38.adb create mode 100644 gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.adb create mode 100644 gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.ads create mode 100644 gcc-4.9/gcc/testsuite/gnat.dg/opt39.adb create mode 100644 gcc-4.9/gcc/testsuite/gnat.dg/overflow_fixed.adb create mode 100644 gcc-4.9/gcc/testsuite/lib/clearcap.exp delete mode 100644 gcc-4.9/gcc/testsuite/lib/target-supports.exp.orig (limited to 'gcc-4.9/gcc/testsuite') diff --git a/gcc-4.9/gcc/testsuite/ChangeLog b/gcc-4.9/gcc/testsuite/ChangeLog index 104703076..20212cd73 100644 --- a/gcc-4.9/gcc/testsuite/ChangeLog +++ b/gcc-4.9/gcc/testsuite/ChangeLog @@ -1,3 +1,585 @@ +2014-07-10 Eric Botcazou + + * gnat.dg/opt39.adb: New test. + +2014-07-09 Edward Smith-Rowland <3dw4rd@verizon.net> + + PR c++/58155 - -Wliteral-suffix warns about tokens which are skipped + g++.dg/cpp0x/pr58155.C: New. + +2014-07-09 Alan Lawrence + + Backport r211369 from trunk. + 2014-06-09 Alan Lawrence + + PR target/61062 + * gcc.target/arm/pr48252.c (main): Expect same result as endian-neutral. + +2014-07-08 Jakub Jelinek + + PR rtl-optimization/61673 + * gcc.c-torture/execute/pr61673.c: New test. + +2014-07-08 Richard Biener + + PR tree-optimization/61680 + * gcc.dg/vect/pr61680.c: New testcase. + + PR tree-optimization/61681 + * gcc.dg/torture/pr61681.c: New testcase. + +2014-07-08 Alan Lawrence + + Backport r211502 from mainline. + 2014-06-10 Alan Lawrence + + PR target/59843 + * gcc.dg/vect/vect-singleton_1.c: New file. + +2014-07-08 Jakub Jelinek + + PR tree-optimization/61725 + * gcc.dg/tree-ssa/vrp93.c: New test. + * gcc.c-torture/execute/pr61725.c: New test. + +2014-07-07 Paul Thomas + + PR fortran/61459 + PR fortran/58883 + * gfortran.dg/allocatable_function_8.f90 : New test + +2014-07-07 Dominique d'Humieres + Mikael Morin + + PR fortran/41936 + * gfortran.dg/class_array_15.f03: Check memory leaks. + +2014-07-06 Jerry DeLisle + + Backport from mainline. + PR libgfortran/61640 + * gfortran.dg/arrayio_16.f90: New test. + +2014-07-04 Jakub Jelinek + + PR middle-end/61654 + * g++.dg/opt/pr61654.C: New test. + + PR tree-optimization/61684 + * gcc.c-torture/compile/pr61684.c: New test. + + PR c++/61382 + Backport from mainline + 2014-06-05 Andreas Schwab + + * g++.dg/cpp0x/initlist86.C (main): Initialize i. + +2014-07-02 Jakub Jelinek + Fritz Reese + + * gfortran.dg/oldstyle_5.f: New test. + +2014-07-01 Paul Pluzhnikov + + PR c++/58753 + PR c++/58930 + PR c++/58704 + + Backported from mainline + 2014-05-20 Paolo Carlini + + * g++.dg/cpp0x/nsdmi-template11.C: New. + * g++.dg/cpp0x/nsdmi-template12.C: Likewise. + * g++.dg/cpp0x/nsdmi-template13.C: Likewise. + +2014-06-28 Edward Smith-Rowland <3dw4rd@verizon.net> + + PR c++/58781 + PR c++/60249 + PR c++/59867 + * testsuite/g++.dg/cpp0x/pr58781.C: New. + * testsuite/g++.dg/cpp0x/pr60249.C: New. + * testsuite/g++.dg/cpp1y/pr59867.C: New. + +2014-06-30 Bill Schmidt + + * gfortran.dg/round_4.f90: Skip for powerpc*-*-linux* since the + test requires greater precision than the current PowerPC long + double implementation supports. + +2014-06-30 Jakub Jelinek + + Backported from mainline + 2014-06-27 Jakub Jelinek + + PR tree-optimization/57233 + PR tree-optimization/61299 + * gcc.dg/pr57233.c: New test. + * gcc.target/i386/pr57233.c: New test. + * gcc.target/i386/sse2-pr57233.c: New test. + * gcc.target/i386/avx-pr57233.c: New test. + * gcc.target/i386/avx2-pr57233.c: New test. + * gcc.target/i386/avx512f-pr57233.c: New test. + * gcc.target/i386/xop-pr57233.c: New test. + + 2014-06-24 Jakub Jelinek + + * gfortran.dg/gomp/udr2.f90 (f7, f9): Add !$omp parallel with + reduction clause. + * gfortran.dg/gomp/udr4.f90 (f4): Likewise. + Remove Label is never defined expected error. + * gfortran.dg/gomp/udr8.f90: New test. + + 2014-06-18 Jakub Jelinek + + * gfortran.dg/gomp/declare-simd-1.f90: New test. + * gfortran.dg/gomp/depend-1.f90: New test. + * gfortran.dg/gomp/target1.f90: New test. + * gfortran.dg/gomp/target2.f90: New test. + * gfortran.dg/gomp/target3.f90: New test. + * gfortran.dg/gomp/udr4.f90: Adjust expected diagnostics. + * gfortran.dg/openmp-define-3.f90: Expect _OPENMP 201307 instead of + 201107. + + 2014-06-10 Jakub Jelinek + + PR fortran/60928 + * gfortran.dg/gomp/allocatable_components_1.f90: Remove dg-error + directives. + * gfortran.dg/gomp/associate1.f90: New test. + * gfortran.dg/gomp/intentin1.f90: New test. + * gfortran.dg/gomp/openmp-simd-1.f90: New test. + * gfortran.dg/gomp/openmp-simd-2.f90: New test. + * gfortran.dg/gomp/openmp-simd-3.f90: New test. + * gfortran.dg/gomp/proc_ptr_2.f90: New test. + + 2014-06-09 Jakub Jelinek + + * gfortran.dg/gomp/udr6.f90 (f1, f2, f3): Use complex(kind=8) + instead of complex(kind=16). + + 2014-06-06 Jakub Jelinek + + * gfortran.dg/gomp/allocatable_components_1.f90: Adjust for + reduction clause diagnostic changes. + * gfortran.dg/gomp/appendix-a/a.31.3.f90: Likewise. + * gfortran.dg/gomp/reduction1.f90: Likewise. + * gfortran.dg/gomp/reduction3.f90: Likewise. + * gfortran.dg/gomp/udr1.f90: New test. + * gfortran.dg/gomp/udr2.f90: New test. + * gfortran.dg/gomp/udr3.f90: New test. + * gfortran.dg/gomp/udr4.f90: New test. + * gfortran.dg/gomp/udr5.f90: New test. + * gfortran.dg/gomp/udr6.f90: New test. + * gfortran.dg/gomp/udr7.f90: New test. + + 2014-05-12 Tobias Burnus + + PR fortran/60127 + * gfortran.dg/gomp/omp_do_concurrent.f90: New. + + 2014-05-11 Jakub Jelinek + + * gfortran.dg/gomp/affinity-1.f90: New test. + +2014-06-30 Sebastian Huber + + * gcc.dg/typeof-2.c: New testcase. + +2014-06-30 Kyrylo Tkachov + + * gcc.target/aarch64/vqdmulhh_lane_s16.c: New test. + * gcc.target/aarch64/vqdmulhs_lane_s32.c: Likewise. + * gcc.target/aarch64/vqrdmulhh_lane_s16.c: Likewise. + * gcc.target/aarch64/vqrdmulhs_lane_s32.c: Likewise. + * gcc.target/aarch64/vqdmlal_high_lane_s16.c: New test. + * gcc.target/aarch64/vqdmlal_high_lane_s32.c: Likewise. + * gcc.target/aarch64/vqdmlal_high_laneq_s16.c: Likewise. + * gcc.target/aarch64/vqdmlal_high_laneq_s32.c: Likewise. + * gcc.target/aarch64/vqdmlal_lane_s16.c: Likewise. + * gcc.target/aarch64/vqdmlal_lane_s32.c: Likewise. + * gcc.target/aarch64/vqdmlal_laneq_s16.c: Likewise. + * gcc.target/aarch64/vqdmlal_laneq_s32.c: Likewise. + * gcc.target/aarch64/vqdmlalh_lane_s16.c: Likewise. + * gcc.target/aarch64/vqdmlals_lane_s32.c: Likewise. + * gcc.target/aarch64/vqdmlsl_high_lane_s16.c: Likewise. + * gcc.target/aarch64/vqdmlsl_high_lane_s32.c: Likewise. + * gcc.target/aarch64/vqdmlsl_high_laneq_s16.c: Likewise. + * gcc.target/aarch64/vqdmlsl_high_laneq_s32.c: Likewise. + * gcc.target/aarch64/vqdmlsl_lane_s16.c: Likewise. + * gcc.target/aarch64/vqdmlsl_lane_s32.c: Likewise. + * gcc.target/aarch64/vqdmlsl_laneq_s32.c: Likewise. + * gcc.target/aarch64/vqdmlslh_lane_s16.c: Likewise. + * gcc.target/aarch64/vqdmlsls_lane_s32.c: Likewise. + * gcc.target/aarch64/vqdmulh_laneq_s16.c: Likewise. + * gcc.target/aarch64/vqdmulh_laneq_s32.c: Likewise. + * gcc.target/aarch64/vqdmulhq_laneq_s16.c: Likewise. + * gcc.target/aarch64/vqdmulhq_laneq_s32.c: Likewise. + * gcc.target/aarch64/vqdmull_high_lane_s16.c: Likewise. + * gcc.target/aarch64/vqdmull_high_lane_s32.c: Likewise. + * gcc.target/aarch64/vqdmull_high_laneq_s16.c: Likewise. + * gcc.target/aarch64/vqdmull_high_laneq_s32.c: Likewise. + * gcc.target/aarch64/vqdmull_lane_s16.c: Likewise. + * gcc.target/aarch64/vqdmull_lane_s32.c: Likewise. + * gcc.target/aarch64/vqdmull_laneq_s16.c: Likewise. + * gcc.target/aarch64/vqdmull_laneq_s32.c: Likewise. + * gcc.target/aarch64/vqdmullh_lane_s16.c: Likewise. + * gcc.target/aarch64/vqdmulls_lane_s32.c: Likewise. + * gcc.target/aarch64/vqrdmulh_laneq_s16.c: Likewise. + * gcc.target/aarch64/vqrdmulh_laneq_s32.c: Likewise. + * gcc.target/aarch64/vqrdmulhq_laneq_s16.c: Likewise. + * gcc.target/aarch64/vqrdmulhq_laneq_s32.c: Likewise. + * gcc.target/aarch64/vector_intrinsics.c: Simplify arm_neon.h include. + (test_vqdmlal_high_lane_s16): Fix parameter type. + (test_vqdmlal_high_lane_s32): Likewise. + (test_vqdmull_high_lane_s16): Likewise. + (test_vqdmull_high_lane_s32): Likewise. + (test_vqdmlsl_high_lane_s32): Likewise. + (test_vqdmlsl_high_lane_s16): Likewise. + * gcc.target/aarch64/scalar_intrinsics.c (test_vqdmlalh_lane_s16): + Fix argument type. + (test_vqdmlals_lane_s32): Likewise. + (test_vqdmlslh_lane_s16): Likewise. + (test_vqdmlsls_lane_s32): Likewise. + (test_vqdmulhh_lane_s16): Likewise. + (test_vqdmulhs_lane_s32): Likewise. + (test_vqdmullh_lane_s16): Likewise. + (test_vqdmulls_lane_s32): Likewise. + (test_vqrdmulhh_lane_s16): Likewise. + (test_vqrdmulhs_lane_s32): Likewise. + +2014-06-30 Igor Zamyatin + + PR middle-end/57541 + * c-c++-common/cilk-plus/AN/pr57541.c: New case added. + * c-c++-common/cilk-plus/AN/pr57541-2.c: New test. + +2014-06-30 Thomas Preud'homme + + Backport from mainline + 2014-06-11 Thomas Preud'homme + + PR tree-optimization/61306 + * gcc.c-torture/execute/pr61306-1.c: New test. + * gcc.c-torture/execute/pr61306-2.c: Likewise. + * gcc.c-torture/execute/pr61306-3.c: Likewise. + +2014-06-27 Jerry DeLisle + + Backport from mainline. + PR libgfortran/61499 + * gfortran.dg/arrayio_15.f90: New test. + +2014-06-27 Bill Schmidt + + * gfortran.dg/nint_2.f90: Don't XFAIL for powerpc64le-*-linux*. + +2014-06-27 Paolo Carlini + + PR c++/61614 + * g++.dg/ext/complit14.C: New. + +2014-06-27 Martin Jambor + + PR ipa/61160 + * g++.dg/ipa/pr61160-2.C: New test. + * g++.dg/ipa/pr61160-3.C: Likewise. + +2014-06-27 Uros Bizjak + + Backport from mainline + 2014-06-26 Uros Bizjak + + PR target/61586 + * gcc.target/alpha/pr61586.c: New test. + +2014-06-26 Adam Butcher + + PR c++/61537 + * g++.dg/template/pr61537.C: New testcase. + +2014-06-26 Martin Jambor + + * g++.dg/ipa/pr60600.C: Fix typo. + * g++.dg/ipa/devirt-25.C: Likewise. + * g++.dg/ipa/pr61540.C: Likewise. + +2014-06-26 Martin Jambor + + * g++.dg/ipa/pr61540.C: Remove dumping test. + +2014-06-25 Bill Schmidt + + * gfortran.dg/default_format_denormal_2.f90: Remove xfail for + powerpc*-*-linux*. + +2014-06-24 Cong Hou + + * gcc.dg/vect/vect-reduc-sad.c: New. + * lib/target-supports.exp (check_effective_target_vect_usad_char): New. + +2014-06-23 Alan Modra + + * gcc.dg/pr61583.c: New. + +2014-06-20 Martin Jambor + + PR ipa/61540 + * g++.dg/ipa/pr61540.C: New test. + +2014-06-17 Yufeng Zhang + + PR target/61483 + * gcc.target/aarch64/aapcs64/type-def.h (struct hfa_fx2_t): New type. + * gcc.target/aarch64/aapcs64/va_arg-13.c: New test. + * gcc.target/aarch64/aapcs64/va_arg-14.c: Ditto. + * gcc.target/aarch64/aapcs64/va_arg-15.c: Ditto. + +2014-06-17 Richard Biener + + PR lto/61012 + * gcc.dg/lto/pr61526_0.c: New testcase. + * gcc.dg/lto/pr61526_1.c: Likewise. + +2014-06-17 Uros Bizjak + + Backport from mainline + 2014-06-06 Uros Bizjak + + PR target/61423 + * gcc.target/i386/pr61423.c: New test. + +2014-06-15 Francois-Xavier Coudert + + Backport from trunk. + PR fortran/45187 + * gfortran.dg/cray_pointers_10.f90: New file. + +2014-06-13 Peter Bergner + + Backport from mainline + + 2014-06-13 Peter Bergner + PR target/61415 + * lib/target-supports.exp (check_effective_target_longdouble128): New. + * gcc.target/powerpc/pack02.c: Use it. + * gcc.target/powerpc/tfmode_off.c: Likewise. + +2014-06-13 Jeff Law + + Backports from mainline: + + 2014-06-13 Ilya Enkovich + + PR rtl-optimization/61094 + PR rtl-optimization/61446 + * gcc.target/i386/pr61446.c : New. + + 2014-06-02 Jeff Law + + PR rtl-optimization/61094 + * g++.dg/pr61094: New test. + +2014-06-12 Jakub Jelinek + + PR middle-end/61486 + * c-c++-common/gomp/pr61486-1.c: New test. + * c-c++-common/gomp/pr61486-2.c: New test. + +2014-06-12 Jeff Law + + Backports from mainline: + 2014-06-05 Jeff Law + + PR tree-optimization/61289 + * g++.dg/pr61289.C: New test. + * g++.dg/pr61289-2.C: New test. + +2014-06-12 Georg-Johann Lay + + Backport from 2014-06-12 trunk r211491 + + PR target/61443 + * gcc.target/avr/torture/pr61443.c: New test. + +2014-06-11 Richard Biener + + PR tree-optimization/61452 + * gcc.dg/torture/pr61452.c: New testcase. + +2014-06-11 Richard Biener + + PR middle-end/61456 + * g++.dg/opt/pr61456.C: New testcase. + +2014-06-09 Paul Thomas + + Backport from trunk. + PR fortran/61406 + * gfortran.dg/associate_17.f90 : New test + +2014-06-07 Jerry DeLisle + + Backport from trunk. + PR libfortran/61173 + * gfortran.dg/arrayio_14.f90: New test. + +2014-06-07 Eric Botcazou + + * gnat.dg/opt38.adb: New test. + * gnat.dg/opt38_pkg.ad[sb]: New helper. + +2014-06-04 Richard Biener + + PR tree-optimization/61383 + * gcc.dg/torture/pr61383-1.c: New testcase. + +2014-06-04 Igor Zamyatin + + PR c/58942 + * c-c++-common/cilk-plus/AN/pr58942.c: Check for correct handling of + the case with a pointer. + +2014-06-04 Marek Polacek + + Backport from mainline + 2014-05-08 Marek Polacek + + PR c/61053 + * gcc.dg/pr61053.c: New test. + +2014-06-03 Martin Jambor + + PR ipa/61160 + * g++.dg/ipa/pr61160-1.C: New test. + +2014-06-03 Andrey Belevantsev + + Backport from mainline + 2014-05-14 Andrey Belevantsev + + PR rtl-optimization/60866 + * gcc.dg/pr60866.c: New test. + +2014-06-03 Andrey Belevantsev + + Backport from mainline + 2014-05-14 Andrey Belevantsev + + PR rtl-optimization/60901 + * gcc.target/i386/pr60901.c: New test. + +2014-06-01 Uros Bizjak + + * g++.dg/pr60969.C (dg-do compile): Change ilp32 target to ia32. + +2014-05-29 Vladimir Makarov + + PR rtl-optimization/61325 + * gcc.target/aarch64/pr61325.c: New. + +2014-05-29 Thomas Koenig + + PR fortran/60834 + Backport from mainline + * gfortran.dg/associate_16.f90: New test. + +2014-05-28 Eric Botcazou + + Backport from mainline + 2014-05-27 Eric Botcazou + + * gnat.dg/overflow_fixed.adb: New test. + +2014-05-28 Richard Biener + + Backport from mainline + 2014-05-28 Richard Biener + + PR middle-end/61045 + * gcc.dg/pr61045.c: New testcase. + + 2014-05-05 Richard Biener + + PR middle-end/61010 + * gcc.dg/torture/pr61010.c: New testcase. + + 2014-04-28 Richard Biener + + PR tree-optimization/60979 + * gcc.dg/graphite/pr60979.c: New testcase. + +2014-05-28 Rainer Orth + + * lib/clearcap.exp: New file. + * gcc.dg/vect/vect.exp: Load clearcap.exp. + Remove clearcap_ldflags handling. + Call clearcap-init, clearcap-finish. + * gcc.target/i386/i386.exp: Likewise. + * gcc.target/i386/clearcap.map: Move to ../config/sol2-clearcap.map. + * gcc.target/i386/clearcapv2.map: Move to + ../config/sol2-clearcapv2.map. + * gcc.target/x86_64/abi/avx/abi-avx.exp: Likewise. + * gcc.target/x86_64/abi/avx512f/abi-avx512f.exp: Likewise. + +2014-05-27 Eric Botcazou + + * gnat.dg/aliasing1.adb (dg-final): Robustify pattern matching. + +2014-05-26 Uros Bizjak + + * c-c++-common/cilk-plus/AN/pr61191.c: Fix dg-error directives. + +2014-05-26 Igor Zamyatin + + PR c/61191 + * c-c++-common/cilk-plus/AN/pr61191.c: Check for correct handling of + the case with syntax error. + +2014-05-22 Peter Bergner + + * gcc.target/powerpc/htm-ttest.c: New test. + +2014-05-21 Igor Zamyatin + + PR c++/60189 + * c-c++-common/cilk-plus/CK/invalid_sync.cc: New test. + +2014-05-18 Jan Hubicka + + PR middle-end/58094 + * g++.dg/ipa/devirt-11.C: Be lax about number of devirtualizations. + +2014-05-18 Eric Botcazou + + * gnat.dg/enum3.adb: New test. + +2014-04-16 Jan Hubicka + + PR ipa/60854 + * g++.dg/torture/pr60854.C: New testcase. + +2014-05-17 Uros Bizjak + + * g++.dg/pr60969.C: Compile for all ilp32 x86 targets. + (dg-options): Add -mfpmath=387. + (dg-final): Check that no MMX registers are used. + +2014-05-16 Vladimir Makarov + + PR rtl-optimization/60969 + * g++.dg/pr60969.C: New. + +2014-05-15 Martin Jambor + + PR ipa/61085 + * g++.dg/ipa/pr61085.C: New test. + +2014-05-15 Jakub Jelinek + + PR tree-optimization/61158 + * gcc.dg/pr61158.c: New test. + 2014-05-14 Matthias Klose PR driver/61106 diff --git a/gcc-4.9/gcc/testsuite/ChangeLog-2013 b/gcc-4.9/gcc/testsuite/ChangeLog-2013 index 0d840b14c..84fff70b1 100644 --- a/gcc-4.9/gcc/testsuite/ChangeLog-2013 +++ b/gcc-4.9/gcc/testsuite/ChangeLog-2013 @@ -1,3 +1,3200 @@ +2013-11-04 Marek Polacek + + Backport from mainline + 2013-11-04 Marek Polacek + + PR c++/58979 + * g++.dg/diagnostic/pr58979.C: New test. + +2013-11-03 H.J. Lu + + Backport from mainline + 2013-10-12 H.J. Lu + + PR target/58690 + * gcc.target/i386/pr58690.c: New test + +2013-11-02 Janus Weil + + Backport from mainline + 2013-09-23 Janus Weil + + PR fortran/58355 + * gfortran.dg/extends_15.f90: New. + +2013-10-29 Uros Bizjak + + Backport from mainline + 2013-08-08 Richard Sandiford + + PR rtl-optimization/58079 + * gcc.dg/torture/pr58079.c: New test. + +2013-10-28 Tom de Vries + + * gcc.target/arm/require-pic-register-loc.c: New test. + +2013-10-26 Uros Bizjak + + Backport from mainline + 2013-10-22 Uros Bizjak + + PR target/58779 + * gcc.target/i386/pr30315.c: Remove MINUSCC, DECCC, MINUSCCONLY + and MINUSCCZEXT defines. Update scan-assembler dg directive. + * gcc.dg/torture/pr58779.c: New test. + +2013-10-25 Richard Henderson + + PR rtl/58542 + * gcc.dg/atomic-store-6.c: New. + +2013-10-25 Tom de Vries + + PR c++/58282 + * g++.dg/tm/noexcept-6.C: New test. + +2013-10-25 Eric Botcazou + + * gcc.c-torture/execute/pr58831.c: New test. + +2013-10-23 Tom de Vries + + PR tree-optimization/58805 + * gcc.dg/pr58805.c: New test. + +2013-10-23 Richard Biener + + * gcc.dg/torture/pr58830.c: New testcase. + + Backport from mainline + 2013-06-24 Richard Biener + + PR tree-optimization/57488 + * gcc.dg/torture/pr57488.c: New testcase. + +2013-10-19 Oleg Endo + + * gcc.target/sh/pr54089-3.c: Fix test for load of constant 31. + +2013-10-17 Paolo Carlini + + PR c++/58596 + * g++.dg/cpp0x/lambda/lambda-nsdmi5.C: New + +2013-10-16 Paolo Carlini + + PR c++/58633 + * g++.dg/cpp0x/decltype57.C: New. + * g++.dg/cpp0x/enum18.C: Revert r174385 changes. + +2013-10-16 Release Manager + + * GCC 4.8.2 released. + +2013-10-14 Rainer Orth + + * gcc.dg/torture/pr58670.c (ASM_STR) [__i386__ || __x86_64__]: Use + btsl. + +2013-10-10 Jakub Jelinek + + PR middle-end/58670 + * gcc.dg/torture/pr58670.c: New test. + +2013-10-09 Jakub Jelinek + + Backport from mainline + 2013-09-26 Richard Biener + + PR tree-optimization/58539 + * gcc.dg/torture/pr58539.c: New testcase. + +2013-10-08 Paolo Carlini + + PR c++/58568 + * g++.dg/cpp0x/lambda/lambda-ice10.C: New. + * g++.old-deja/g++.mike/misc9.C: Adjust. + +2013-10-08 Andreas Krebbel + + * gcc.target/s390/htm-nofloat-2.c: Add -mzarch to asm options. + +2013-10-07 Andreas Krebbel + + * gcc.target/s390/htm-nofloat-2.c: New testcase. + +2013-10-07 Andreas Krebbel + + Backport from mainline + 2013-06-27 Andreas Krebbel + + * gcc.target/s390/htm-1.c: New file. + * gcc.target/s390/htm-nofloat-1.c: New file. + * gcc.target/s390/htm-xl-intrin-1.c: New file. + +2013-10-04 Tobias Burnus + + PR fortran/57697 + PR fortran/58469 + * gfortran.dg/defined_assignment_8.f90: New. + * gfortran.dg/defined_assignment_9.f90: New. + * gfortran.dg/defined_assignment_10.f90: New. + * gfortran.dg/defined_assignment_11.f90: New. + +2013-10-04 Marcus Shawcroft + + Backport from mainline. + + PR target/58460 + * gcc.target/aarch64/pr58460.c: New file. + +2013-10-02 Paolo Carlini + + PR c++/58535 + * g++.dg/parse/crash62.C: New. + +2013-10-01 Jakub Jelinek + + PR target/58574 + * gcc.c-torture/execute/pr58574.c: New test. + +2013-09-30 Jakub Jelinek + + PR middle-end/58564 + * gcc.c-torture/execute/pr58564.c: New test. + +2013-09-24 Cong Hou + + Backport from mainline: + 2013-09-24 Richard Biener + + PR middle-end/58513 + * g++.dg/vect/pr58513.cc: New testcase. + +2013-09-23 Eric Botcazou + + * gnat.dg/opt28.ad[sb]: New test. + * gnat.dg/opt28_pkg.ads: New helper. + +2013-09-23 Alan Modra + + * gcc.target/powerpc/pr58330.c: New. + +2013-09-20 Cong Hou + + Backport from mainline: + 2013-09-13 Cong Hou + + * gcc.dg/vect/vect-reduc-dot-s16c.c: Add a test case with dot product + on two arrays with short and int types. This should not be recognized + as a dot product pattern. + +2013-09-18 Paolo Carlini + + PR c++/58457 + * g++.dg/parse/using4.C: New. + +2013-09-18 Eric Botcazou + + * gnat.dg/array_bounds_test2.adb: New test. + +2013-09-18 Eric Botcazou + + * gnat.dg/in_out_parameter4.adb: New test. + +2013-09-17 Kyrylo Tkachov + + PR tree-optimization/58088 + * gcc.c-torture/compile/pr58088.c: New test. + +2013-09-13 Christian Bruel + + PR target/58314 + * gcc.target/sh/torture/pr58314.c: New test. + +2013-09-11 Richard Biener + + PR middle-end/58377 + * g++.dg/uninit-pred-4.C: New testcase. + +2013-09-11 Jakub Jelinek + + PR tree-optimization/58385 + * gcc.c-torture/execute/pr58385.c: New test. + +2013-09-10 Jakub Jelinek + + PR rtl-optimization/58365 + * gcc.c-torture/execute/pr58365.c: New test. + +2013-09-09 Jakub Jelinek + + PR c++/58325 + * g++.dg/warn/Wunused-var-21.C: New test. + + PR tree-optimization/58364 + * gcc.c-torture/execute/pr58364.c: New test. + +2013-09-09 Kyrylo Tkachov + + PR target/57735 + * g++.dg/ext/pr57735.C: New test. + +2013-09-09 Richard Biener + + Backport from mainline + 2013-08-27 Richard Biener + + PR tree-optimization/57521 + * gcc.dg/torture/pr57521.c: New testcase. + +2013-09-09 Richard Biener + + Backport from mainline + 2013-09-03 Richard Biener + + PR middle-end/57656 + * gcc.dg/torture/pr57656.c: New testcase. + +2013-09-09 Richard Biener + + Backport from mainline + 2013-08-29 Richard Biener + + PR tree-optimization/57685 + * gcc.dg/torture/pr57685.c: New testcase. + +2013-09-09 Richard Biener + + Backport from mainline + 2013-08-30 Richard Biener + + PR tree-optimization/58223 + * gcc.dg/torture/pr58223.c: New testcase. + * gcc.dg/tree-ssa/ldist-16.c: Flip expected behavior. + +2013-09-03 Richard Biener + + Backport from mainline + 2013-08-29 Richard Biener + + PR tree-optimization/58246 + * gcc.dg/torture/pr58246.c: New testcase. + +2013-09-03 Richard Biener + + Backport from mainline + 2013-08-30 Richard Biener + + PR tree-optimization/58228 + * gcc.dg/torture/pr58228.c: New testcase. + +2013-09-03 Richard Biener + + Backport from mainline + 2013-08-30 Richard Biener + + PR tree-optimization/58010 + * gcc.dg/pr58010.c: New testcase. + +2013-08-30 Jakub Jelinek + + PR tree-optimization/58277 + * gcc.c-torture/execute/pr58277-1.c: New test. + * gcc.c-torture/execute/pr58277-2.c: New test. + +2013-08-29 Jakub Jelinek + + Backported from mainline + 2013-07-22 Georg-Johann Lay + + PR testsuite/52641 + * gcc.dg/torture/pr57381.c: Add dg-require-effective-target int32plus. + + 2013-05-27 Richard Biener + + PR tree-optimization/57417 + * gcc.dg/torture/pr57417.c: New testcase. + + PR tree-optimization/57396 + * gfortran.fortran-torture/execute/pr57396.f90: New testcase. + + PR tree-optimization/57343 + * gcc.dg/torture/pr57343.c: New testcase. + + 2013-05-23 Richard Biener + + PR middle-end/57381 + * gcc.dg/torture/pr57381.c: New testcase. + +2013-08-28 Jakub Jelinek + + PR middle-end/58257 + * c-c++-common/gomp/pr58257.c: New test. + +2013-08-28 Richard Biener + + Backport from mainline + 2013-06-24 Richard Biener + + PR middle-end/56977 + * gcc.dg/pr56977.c: New testcase. + +2013-08-24 Mikael Morin + + PR fortran/57798 + * gfortran.dg/inline_sum_5.f90: New. + +2013-08-24 Janus Weil + + Backport from trunk: + 2013-08-22 Janus Weil + + PR fortran/58185 + * gfortran.dg/select_type_34.f90: New. + +2013-08-23 Jakub Jelinek + + PR target/58218 + * gcc.target/i386/pr58218.c: New test. + + PR tree-optimization/58209 + * gcc.c-torture/execute/pr58209.c: New test. + +2013-08-20 Paolo Carlini + + PR c++/58190 + * g++.dg/pr57878.C: Use __SIZE_TYPE__. + +2013-08-18 Jakub Jelinek + + PR tree-optimization/58006 + * g++.dg/opt/pr58006.C: New test. + +2013-08-16 Jakub Jelinek + + PR tree-optimization/58164 + * gcc.c-torture/compile/pr58164.c: New test. + + PR tree-optimization/58165 + * g++.dg/opt/pr58165.C: New test. + +2013-08-14 Jakub Jelinek + + PR tree-optimization/58145 + * gcc.dg/pr58145-1.c: New test. + * gcc.dg/pr58145-2.c: New test. + +2013-08-13 Jakub Jelinek + + PR sanitizer/56417 + * gcc.dg/asan/pr56417.c: New test. + +2013-08-13 Vladimir Makarov + + Backport from mainline + 2013-06-06 Vladimir Makarov + + PR rtl-optimization/57459 + * gcc.target/i386/pr57459.c: New test. + +2013-08-13 Eric Botcazou + + * gnat.dg/loop_optimization16.adb: New test. + * gnat.dg/loop_optimization16_pkg.ad[sb]: New helper. + +2013-08-13 Marek Polacek + + PR tree-optimization/57980 + * gcc.dg/pr57980.c: New test. + +2013-08-13 Uros Bizjak + + Backport from mainline + 2013-08-12 Perez Read + + PR target/58132 + * gcc.target/i386/movabs-1.c: New test. + +2013-08-11 Janus Weil + + Backport from trunk: + 2013-08-09 Janus Weil + + PR fortran/58058 + * gfortran.dg/transfer_intrinsic_6.f90: New. + +2013-08-09 Zhenqiang Chen + + Backport from mainline: + 2013-08-09 Zhenqiang Chen + + * gcc.target/arm/lp1189445.c: New testcase. + +2013-08-06 Martin Jambor + Bernd Edlinger + + * gcc.dg/torture/pr58041.c (foo): Accept z by reference. + (a): Fix constructor. + +2013-08-06 Martin Jambor + + PR middle-end/58041 + * gcc.dg/torture/pr58041.c: New test. + * gcc.target/arm/pr58041.c: Likewise. + +2013-07-28 Tobias Burnus + + Backport from mainline + 2013-05-28 Tobias Burnus + + PR fortran/57435 + * gfortran.dg/use_29.f90: New. + +2013-07-25 Paolo Carlini + + PR c++/57981 + * g++.dg/cpp0x/pr57981.C: New. + +2013-07-25 Terry Guo + + Backport from mainline: + 2013-07-25 Terry Guo + + * gcc.target/arm/thumb1-Os-mult.c: New test case. + +2013-07-19 Wei Mi + + Backport from mainline: + 2013-07-18 Wei Mi + + PR rtl-optimization/57878 + * g++.dg/pr57878.C: New test. + +2013-07-19 Georg-Johann Lay + + Backport from 2013-07-19 trunk r201051. + + PR target/57516 + * gcc.target/avr/torture/builtins-4-roundfx.c (test2hr, test2k): + Adjust to corrected rounding. + +2013-07-19 Kirill Yukhin + + * gcc.target/i386/bmi-1.c: Extend with new instrinsics. + Fix scan patterns. + * gcc.target/i386/bmi-2.c: Ditto. + * gcc.target/i386/bmi-bextr-4.c: New. + * gcc.target/i386/bmi-bextr-5.c: Ditto. + +2013-07-16 Iain Sandoe + + PR target/55656 + PR target/55657 + * obj-c++.dg/cxx-ivars-3.mm: Use NSObject instead of Object. + * obj-c++.dg/strings/const-cfstring-5.mm: Likewise. + * obj-c++.dg/torture/strings/const-str-10.mm: Likewise. + * obj-c++.dg/torture/strings/const-str-9.mm: Likewise. + * objc.dg/image-info.m: Likewise. + * objc.dg/symtab-1.m: Likewise. + * objc.dg/torture/strings/const-str-10.m: Likewise. + * objc.dg/torture/strings/const-str-11.m: Likewise. + * objc.dg/torture/strings/const-str-9.m: Likewise. + * objc.dg/zero-link-1.m: Likewise. + * objc.dg/zero-link-2.m: Likewise. + * objc.dg/no-extra-load.m: Avoid Foundation.h. + * objc.dg/objc-foreach-4.m: Likewise. + * objc.dg/objc-foreach-5.m: Likewise. + * obj-c++.dg/proto-lossage-7.mm: Use NSObject instead of Object + (for Darwin). + * obj-c++.dg/strings/const-str-12.mm: Likewise. + * obj-c++.dg/syntax-error-1.mm: Likewise. + * objc.dg/method-6.m: Likewise. + * objc.dg/pr23214.m: Likewise. + * objc.dg/proto-lossage-7.m: Likewise. + * objc.dg/strings/const-str-12b.m: Likewise. + * objc.dg/zero-link-3.m: Likewise. + * obj-c++.dg/method-12.mm: Skip on Darwin versions without 'Object'. + * objc.dg/encode-7-next-64bit.m: Use NSObject instead of Object, + adjust headers, interfaces and encoded types to reflect current system + versions. Add FIXME and outputs from current system compiler for + reference. + +2013-07-10 Janis Johnson + + * gcc.target/powerpc/20020118-1.c: Force 128-bit stack alignment + for EABI targets. + * gcc.c-torture/execute/nest-align-1.x: New. + +2013-07-08 Janis Johnson + + * gcc.target/powerpc/tfmode_off.c: Skip for EABI targets. + + * gcc.target/powerpc/ppc-spe64-1.c: Update expected error message. + + * gcc.target/powerpc/pr47197.c: Require powerpc_altivec_ok. + +2013-07-08 Tobias Burnus + + PR fortran/57785 + * gfortran.dg/dot_product_2.f90: New. + +2013-07-08 Jakub Jelinek + + PR rtl-optimization/57829 + * gcc.c-torture/execute/pr57829.c: New test. + +2013-07-05 Paolo Carlini + + PR c++/57645 + * g++.dg/cpp0x/noexcept21.C: New. + +2013-07-03 Jakub Jelinek + + PR target/57777 + * gcc.target/i386/pr57777.c: New test. + + PR c++/57771 + * g++.dg/template/arg9.C: New test. + +2013-06-28 Jakub Jelinek + + PR target/57736 + * gcc.target/i386/pr57736.c: New test. + +2013-06-27 Jakub Jelinek + + PR target/57623 + * gcc.target/i386/bmi-bextr-3.c: New test. + + PR target/57623 + * gcc.target/i386/bmi2-bzhi-1.c: New test. + +2013-06-24 Martin Jambor + + PR tree-optimization/57358 + * gcc.dg/ipa/pr57358.c: New test. + +2013-06-24 Alan Modra + + * gcc.target/powerpc/altivec-consts.c: Correct for little-endian. + Add scan-assembler-not "lvx". + * gcc.target/powerpc/le-altivec-consts.c: New. + +2013-06-21 Uros Bizjak + + Backport from mainline + 2013-06-20 Uros Bizjak + + PR target/57655 + * gcc.target/i386/pr57655.c: New test. + +2013-06-21 Paolo Carlini + + PR c++/53211 + * g++.dg/cpp0x/decltype55.C: New. + +2013-06-20 Wei Mi + + Backport from mainline + 2013-06-19 Wei Mi + + PR rtl-optimization/57518 + * testsuite/gcc.dg/pr57518.c: New test. + +2013-06-11 Tobias Burnus + + PR fortran/57508 + * gfortran.dg/defined_assignment_7.f90: New. + +2013-06-10 Oleg Endo + + Backport from mainline + 2013-05-20 Oleg Endo + + PR target/56547 + * gcc.target/sh/pr56547-1.c: New. + * gcc.target/sh/pr56547-2.c: New. + +2013-06-09 Jakub Jelinek + + PR target/57568 + * gcc.c-torture/execute/pr57568.c: New test. + +2013-06-04 Tobias Burnus + + Backport from mainline + 2013-05-22 Tobias Burnus + + PR fortran/57364 + * gfortran.dg/defined_assignment_6.f90: New. + +2013-05-31 Janus Weil + Tobias Burnus + + PR fortran/57217 + * gfortran.dg/typebound_override_4.f90: New. + +2013-05-31 Release Manager + + * GCC 4.8.1 released. + +2013-05-26 Eric Botcazou + + * gnat.dg/specs/last_bit.ads: New test. + +2013-05-24 Greta Yorsh + + Backport from mainline + 2013-05-02 Greta Yorsh + + PR target/56732 + * gcc.target/arm/pr56732-1.c: New test. + +2013-05-24 Alexander Ivchenko + + PR tree-ssa/57385 + * gcc.dg/tree-ssa/pr57385.c: New test. + +2013-05-23 Martin Jambor + + PR middle-end/57347 + * gcc.dg/ipa/pr57347.c: New test. + +2013-05-23 Richard Biener + + PR rtl-optimization/57341 + * gcc.dg/torture/pr57341.c: New testcase. + +2013-05-23 Jakub Jelinek + + PR middle-end/57344 + * gcc.c-torture/execute/pr57344-1.c: New test. + * gcc.c-torture/execute/pr57344-2.c: New test. + * gcc.c-torture/execute/pr57344-3.c: New test. + * gcc.c-torture/execute/pr57344-4.c: New test. + +2013-05-22 Richard Biener + + Backport from mainline + 2013-05-21 Richard Biener + + PR tree-optimization/57330 + * gcc.dg/torture/pr57330.c: New testcase. + + 2013-05-21 Richard Biener + + PR tree-optimization/57303 + * gcc.dg/torture/pr57303.c: New testcase. + +2013-05-21 Jakub Jelinek + + PR tree-optimization/57321 + * gcc.c-torture/execute/pr57321.c: New test. + +2013-05-17 Jakub Jelinek + + PR rtl-optimization/57281 + PR rtl-optimization/57300 + * gcc.dg/pr57300.c: New test. + * gcc.c-torture/execute/pr57281.c: New test. + +2013-05-16 Dodji Seketeli + + PR c++/56782 - Regression with empty pack expansions + * g++.dg/cpp0x/variadic142.C: New test file. + +2013-05-14 Jakub Jelinek + + PR c++/57274 + * c-c++-common/Wsequence-point-1.c: New test. + + PR middle-end/57251 + * gcc.dg/torture/pr57251.c: New test. + +2013-05-13 Uros Bizjak + + PR target/57264 + * gcc.target/i386/pr57264.c: New test. + +2013-05-13 Jakub Jelinek + + PR tree-optimization/57230 + * gcc.dg/strlenopt-23.c: New test. + +2013-05-10 Richard Biener + + PR tree-optimization/57214 + * gcc.dg/torture/pr57214.c: New testcase. + +2013-05-09 Martin Jambor + + PR middle-end/56988 + * gcc.dg/ipa/pr56988.c: New test. + +2013-05-08 Marc Glisse + + * c-c++-common/vector-scalar-2.c: New testcase. + +2013-05-07 Tobias Burnus + + Backport from mainline + 2013-05-02 Tobias Burnus + + PR fortran/57142 + * gfortran.dg/size_kind_2.f90: New. + * gfortran.dg/size_kind_3.f90: New. + +2013-05-07 Jakub Jelinek + + PR tree-optimization/57149 + * gcc.dg/pr57149.c: New test. + + PR debug/57184 + * gcc.dg/pr57184.c: New test. + +2013-05-07 Richard Biener + + Backport from mainline + 2013-05-06 Richard Biener + + PR tree-optimization/57185 + * gcc.dg/autopar/pr57185.c: New testcase. + + 2013-04-19 Richard Biener + + PR tree-optimization/57000 + * gcc.dg/tree-ssa/reassoc-27.c: New testcase. + +2013-05-07 Eric Botcazou + + * gnat.dg/specs/array3.ads: New test. + +2013-05-06 Michael Meissner + + Backport from trunk + 2013-05-03 Michael Meissner + + PR target/57150 + * gcc.target/powerpc/pr57150.c: New file. + +2013-05-06 Uros Bizjak + + Backport from mainline + 2013-05-06 Uros Bizjak + + PR target/57106 + * gcc.target/i386/pr57106.c: New test. + +2013-05-06 Paolo Carlini + + PR c++/57183 + * g++.dg/cpp0x/auto38.C: New. + +2013-05-04 Jakub Jelinek + + PR tree-optimization/56205 + * gcc.dg/tree-ssa/stdarg-6.c: Add cleanup-tree-dump "stdarg". + +2013-05-03 Jakub Jelinek + + PR rtl-optimization/57130 + * gcc.c-torture/execute/pr57130.c: New test. + +2013-05-03 Marek Polacek + + Backport from mainline + 2013-04-25 Marek Polacek + + PR tree-optimization/57066 + * gcc.dg/torture/builtin-logb-1.c: Adjust testcase. + +2013-05-02 Jakub Jelinek + + PR rtl-optimization/57131 + * gcc.c-torture/execute/pr57131.c: New test. + +2013-05-02 Vladimir Makarov + + Backport from mainline + PR target/57091 + * gcc.target/i386/pr57091.c: New test. + +2013-05-02 Vladimir Makarov + + Backport from mainline + 2013-04-29 Vladimir Makarov + + PR target/57097 + * gcc.target/i386/pr57097.c: New test. + +2013-05-02 Vladimir Makarov + + Backport from mainline + 2013-04-24 Vladimir Makarov + + PR rtl-optimizations/57046 + * gcc.target/i386/pr57046.c: New test. + +2013-05-02 Vladimir Makarov + + Backport from mainline + 2013-04-22 Vladimir Makarov + + PR target/57018 + * gcc.target/i386/pr57018.c: New test. + +2013-05-02 Vladimir Makarov + + Backport from mainline + 2013-04-18 Jakub Jelinek + + PR rtl-optimization/56999 + * g++.dg/opt/pr56999.C: New test. + +2013-05-02 Vladimir Makarov + + Backport from mainline + 2013-04-19 Vladimir Makarov + + PR rtl-optimization/56847 + * gcc.dg/pr56847.c: New test. + +2013-05-02 Ian Bolton + + Backport from mainline (fix to botched commit) + 2013-04-04 Tejas Belagod + + * gcc.target/aarch64/inc/asm-adder-clobber-lr.c: Remove duplication. + * gcc.target/aarch64/inc/asm-adder-no-clobber-lr.c: Likewise. + * gcc.target/aarch64/test-framepointer-1.c: Likewise. + * gcc.target/aarch64/test-framepointer-2.c: Likewise. + * gcc.target/aarch64/test-framepointer-3.c: Likewise. + * gcc.target/aarch64/test-framepointer-4.c: Likewise. + * gcc.target/aarch64/test-framepointer-5.c: Likewise. + * gcc.target/aarch64/test-framepointer-6.c: Likewise. + * gcc.target/aarch64/test-framepointer-7.c: Likewise. + * gcc.target/aarch64/test-framepointer-8.c: Likewise. + + Backport from mainline + 2013-03-28 Ian Bolton + + * gcc.target/aarch64/inc/asm-adder-clobber-lr.c: New test. + * gcc.target/aarch64/inc/asm-adder-no-clobber-lr.c: Likewise. + * gcc.target/aarch64/test-framepointer-1.c: Likewise. + * gcc.target/aarch64/test-framepointer-2.c: Likewise. + * gcc.target/aarch64/test-framepointer-3.c: Likewise. + * gcc.target/aarch64/test-framepointer-4.c: Likewise. + * gcc.target/aarch64/test-framepointer-5.c: Likewise. + * gcc.target/aarch64/test-framepointer-6.c: Likewise. + * gcc.target/aarch64/test-framepointer-7.c: Likewise. + * gcc.target/aarch64/test-framepointer-8.c: Likewise. + +2013-05-01 Paolo Carlini + + PR c++/57092 + * g++.dg/cpp0x/decltype53.C: New. + +2013-04-30 Jakub Jelinek + + PR tree-optimization/57104 + * gcc.dg/pr57104.c: New test. + +2013-04-30 Uros Bizjak + + Backport from mainline + 2013-04-29 Uros Bizjak + + PR target/44578 + * gcc.target/i386/pr44578.c: New test. + + Backport from mainline + 2013-04-29 Uros Bizjak + + PR target/57098 + * gcc.target/i386/pr57098.c: New test. + +2013-04-29 Paolo Carlini + + PR c++/56450 + * g++.dg/cpp0x/decltype52.C: New. + +2013-04-29 Richard Biener + + PR middle-end/57103 + * gcc.dg/autopar/pr57103.c: New testcase. + +2013-04-29 Christian Bruel + + PR target/57108 + * gcc.target/sh/pr57108.c: New test. + +2013-04-29 Jakub Jelinek + + PR tree-optimization/57083 + * gcc.dg/torture/pr57083.c: New test. + +2013-04-28 Jerry DeLisle + + Backport from trunk: + + PR fortran/51825 + * gfortran.dg/namelist_77.f90: New test. + * gfortran.dg/namelist_78.f90: New test. + +2013-04-28 Jerry DeLisle + + PR fortran/56786 + * gfortran.dg/namelist_81.f90: New test. + +2013-04-27 Jerry DeLisle + + Backport from trunk: + + PR fortran/52512 + * gfortran.dg/namelist_79.f90: New test. + +2013-04-27 Jakub Jelinek + + PR target/56866 + * gcc.c-torture/execute/pr56866.c: New test. + * gcc.target/i386/pr56866.c: New test. + +2013-04-26 Janus Weil + + Backports from trunk: + + PR fortran/56968 + * gfortran.dg/proc_ptr_41.f90: New. + + PR fortran/56814 + * gfortran.dg/proc_ptr_42.f90: New. + + PR fortran/53685 + PR fortran/57022 + * gfortran.dg/transfer_check_4.f90: New. + +2013-04-25 Jakub Jelinek + + PR rtl-optimization/57003 + * gcc.target/i386/pr57003.c: New test. + +2013-04-25 Ian Bolton + + Backported from mainline. + 2013-03-22 Ian Bolton + + * gcc.target/aarch64/movk.c: New test. + +2013-04-24 Paolo Carlini + + PR c++/56970 + * g++.dg/cpp0x/sfinae45.C: New. + +2013-04-23 Bill Schmidt + + Backported from mainline. + PR rtl-optimization/56605 + * gcc.target/powerpc/pr56605.c: New. + +2013-04-22 Marek Polacek + + Backport from mainline + 2013-04-22 Marek Polacek + + PR sanitizer/56990 + * gcc.dg/pr56990.c: New test. + +2013-04-22 Thomas Koenig + Mikael Morin + + PR fortran/56872 + * gfortran.dg/array_constructor_45.f90: New test. + * gfortran.dg/array_constructor_46.f90: New test. + * gfortran.dg/array_constructor_47.f90: New test. + * gfortran.dg/array_constructor_40.f90: Adjust number of + while loops. + +2013-04-18 Mikael Morin + + PR fortran/56816 + * gfortran.dg/select_type_33.f03: New test. + +2013-04-18 Jakub Jelinek + + PR tree-optimization/56984 + * gcc.c-torture/compile/pr56984.c: New test. + + PR rtl-optimization/56992 + * gcc.dg/pr56992.c: New test. + +2013-04-16 Uros Bizjak + + Backport from mainline + 2013-04-16 Uros Bizjak + + * g++.dg/ipa/devirt-c-7.C: Require nonpic effective target. + * gcc.c-torture/execute/pr33992.x: Remove. + * gcc.c-torture/execute/pr33992.c (foo): Declare as static. + * gcc.dg/uninit-pred-5_a.c (foo): Ditto. + * gcc.dg/uninit-pred-5_b.c (foo): Ditto. + + Backport from mainline + 2013-03-27 Alexander Ivchenko + + * g++.dg/ipa/ivinline-1.C: Add target nonpic. + * g++.dg/ipa/ivinline-2.C: Likewise. + * g++.dg/ipa/ivinline-3.C: Likewise. + * g++.dg/ipa/ivinline-4.C: Likewise. + * g++.dg/ipa/ivinline-5.C: Likewise. + * g++.dg/ipa/ivinline-7.C: Likewise. + * g++.dg/ipa/ivinline-8.C: Likewise. + * g++.dg/ipa/ivinline-9.C: Likewise. + * g++.dg/cpp0x/noexcept03.C: Likewise. + * gcc.dg/const-1.c: Likewise. + * gcc.dg/ipa/pure-const-1.c: Likewise. + * gcc.dg/noreturn-8.c: Likewise. + * gcc.target/i386/mmx-1.c: Likewise. + * gcc.dg/tree-ssa/ipa-split-5.c: Likewise. + * gcc.dg/tree-ssa/loadpre6.c: Likewise. + * gcc.c-torture/execute/pr33992.x: New file. + +2013-04-15 Jakub Jelinek + + PR tree-optimization/56962 + * gcc.c-torture/execute/pr56962.c: New test. + +2013-04-15 Eric Botcazou + + * gcc.dg/pr56890-1.c: New test. + * gcc.dg/pr56890-2.c: Likewise. + +2013-04-12 Vladimir Makarov + + PR target/56903 + * gcc.target/i386/pr56903.c: New test. + +2013-04-12 Jakub Jelinek + + PR tree-optimization/56918 + PR tree-optimization/56920 + * gcc.dg/vect/pr56918.c: New test. + * gcc.dg/vect/pr56920.c: New test. + +2013-04-11 Jakub Jelinek + + PR c++/56895 + * g++.dg/template/arrow4.C: New test. + +2013-04-11 Paolo Carlini + + PR c++/56913 + * g++.dg/cpp0x/sfinae44.C: New. + +2013-04-11 James Greenhalgh + + Backported from mainline. + 2013-04-11 James Greenhalgh + + * gcc.target/aarch64/vect-fcm.x: Add check for zero forms of + inverse operands. + * gcc.target/aarch64/vect-fcm-eq-d.c: Check that new zero form + loop is vectorized. + * gcc.target/aarch64/vect-fcm-eq-f.c: Likewise. + * gcc.target/aarch64/vect-fcm-ge-d.c: Check that new zero form + loop is vectorized and that the correct instruction is generated. + * gcc.target/aarch64/vect-fcm-ge-f.c: Likewise. + * gcc.target/aarch64/vect-fcm-gt-d.c: Likewise. + * gcc.target/aarch64/vect-fcm-gt-f.c: Likewise. + +2013-04-11 Jakub Jelinek + + PR tree-optimization/56899 + * gcc.c-torture/execute/pr56899.c: New test. + +2013-04-10 Jakub Jelinek + + PR c++/56895 + * g++.dg/template/arrow3.C: New test. + + Backported from mainline + 2013-04-09 Jakub Jelinek + + PR middle-end/56883 + * c-c++-common/gomp/pr56883.c: New test. + +2013-04-08 Thomas Koenig + + PR fortran/56782 + Backport from trunk. + * gfortran.dg/array_constructor_44.f90: New test. + +2013-04-08 Jakub Jelinek + + * gcc.c-torture/execute/pr56837.c: New test. + +2013-04-04 Marek Polacek + + Backport from mainline: + 2013-04-04 Marek Polacek + + PR tree-optimization/48186 + * gcc.dg/pr48186.c: New test. + +2013-04-04 Kyrylo Tkachov + + Backport from mainline: + 2013-03-25 Kyrylo Tkachov + + PR target/56720 + * gcc.target/arm/neon-vcond-gt.c: New test. + * gcc.target/arm/neon-vcond-ltgt.c: Likewise. + * gcc.target/arm/neon-vcond-unordered.c: Likewise. + +2013-04-04 Richard Biener + + PR tree-optimization/56837 + * g++.dg/torture/pr56837.C: New testcase. + +2013-04-03 Marek Polacek + + Backport from mainline: + 2013-04-03 Marek Polacek + + PR sanitizer/55702 + * gcc.dg/pr55702.c: New test. + +2013-04-03 Jakub Jelinek + + PR debug/56819 + * g++.dg/debug/pr56819.C: New test. + +2013-04-03 Richard Biener + + PR tree-optimization/56817 + * g++.dg/torture/pr56817.C: New testcase. + +2013-04-03 Richard Biener + + PR tree-optimization/55964 + * gcc.dg/torture/pr55964-2.c: New testcase. + +2013-04-03 Richard Biener + + PR tree-optimization/56501 + * gcc.dg/torture/pr56501.c: New testcase. + +2013-04-03 Richard Biener + + PR tree-optimization/56407 + * gcc.dg/torture/pr56407.c: New testcase. + +2013-04-02 Jakub Jelinek + + PR rtl-optimization/56745 + * gcc.c-torture/compile/pr56745.c: New test. + +2013-04-02 Tobias Burnus + + Backport from mainline: + 2013-03-28 Tobias Burnus + + PR fortran/56735 + * gfortran.dg/namelist_80.f90: New. + +2013-04-02 Tobias Burnus + + Backport from mainline: + 2013-03-29 Tobias Burnus + + PR fortran/56737 + * testsuite/gfortran.dg/fmt_cache_3.f90: New. + +2013-04-02 Richard Biener + + PR middle-end/56768 + * g++.dg/torture/pr56768.C: New testcase. + +2013-04-01 Paolo Carlini + + PR c++/55951 + * g++.dg/ext/desig5.C: New. + +2013-03-29 Kirill Yukhin + + * gcc.target/i386/avx2-vbroadcastsi128-1.c: Fix intrinsic name. + * gcc.target/i386/avx2-vbroadcastsi128-1.c: Ditto. + +2013-03-28 Tejas Belagod + + PR middle-end/56694 + * g++.dg/torture/pr56694.C: Fix test case to build on bare-metal + targets. + +2013-03-25 Paolo Carlini + + PR c++/56722 + * g++.dg/cpp0x/range-for23.C: New. + +2013-03-25 Richard Biener + + PR middle-end/56694 + * g++.dg/torture/pr56694.C: New testcase. + +2013-03-25 Rainer Orth + + Backport from mainline: + 2013-03-20 Rainer Orth + + PR fortran/54932 + * gfortran.dg/do_1.f90: Don't xfail. + +2013-03-24 Tobias Burnus + + PR fortran/56696 + * gfortran.dg/eof_5.f90: New. + +2013-03-22 Sebastian Huber + + * gcc.c-torture/execute/builtins/builtins.exp: Sort targets + alphabetically. + +2013-03-22 Paolo Carlini + + PR c++/56582 + * g++.dg/cpp0x/constexpr-array5.C: New. + +2013-03-22 H.J. Lu + + PR target/56560 + * gcc.target/i386/pr56560.c: New file. + +2013-03-22 Sebastian Huber + + PR testsuite/55994 + * gcc.c-torture/execute/builtins/builtins.exp: Add + -Wl,--allow-multiple-definition for RTEMS targets. + +2013-03-22 Jakub Jelinek + + Backported from mainline + 2013-03-16 Jakub Jelinek + + PR c++/56607 + * g++.dg/warn/Wdiv-by-zero-2.C: New test. + * c-c++-common/pr56607.c: New test. + +2013-03-22 Release Manager + + * GCC 4.8.0 released. + +2013-03-20 Richard Biener + + PR tree-optimization/56661 + * gcc.dg/torture/pr56661.c: New testcase. + +2013-03-20 Jakub Jelinek + + PR tree-optimization/56635 + * g++.dg/torture/pr56635.C: New test. + +2013-03-15 Tobias Burnus + + PR fortran/56615 + * gfortran.dg/transfer_intrinsic_5.f90: New. + +2013-03-15 Kai Tietz + + * gcc.target/i386/movti.c: Don't test for x64 mingw. + * gcc.target/i386/pr20020-1.c: Likewise. + * gcc.target/i386/pr20020-2.c: Likewise. + * gcc.target/i386/pr20020-3.c: Likewise. + * gcc.target/i386/pr53425-1.c: Likewise. + * gcc.target/i386/pr53425-2.c: Likewise. + * gcc.target/i386/pr55093.c: Likewise. + * gcc.target/i386/pr53907.c: Adjust test for LLP64 targets. + +2013-03-15 Jakub Jelinek + + PR debug/56307 + * gcc.dg/tree-ssa/pr55579.c: Add -fvar-tracking-assignments to + dg-options. Remove 32-bit hppa*-*-hpux* xfail. + +2013-03-14 Jakub Jelinek + + PR tree-optimization/53265 + * gcc.dg/graphite/scop-3.c (toto): Increase array size to avoid + undefined behavior. + * gcc.dg/graphite/id-6.c (test): Likewise. + * gcc.dg/graphite/pr35356-2.c: Adjust regexp patterns to only look for + MIN_EXPR and MAX_EXPR in GIMPLE stmts. + + PR tree-optimization/53265 + * gcc.dg/pr53265.c: New test. + * gcc.dg/torture/pr49518.c: Add -Wno-aggressive-loop-optimizations + to dg-options. + * g++.dg/opt/longbranch2.C (EBCOTLut): Double sizes of a2 and a3 + arrays. + * gcc.dg/tree-ssa/cunroll-10.c (main): Rename to foo. Add argument + n, use it as high bound instead of 4. + +2013-03-13 Oleg Endo + + PR target/49880 + * gcc.target/sh/pr49880-1.c: New. + * gcc.target/sh/pr49880-2.c: New. + * gcc.target/sh/pr49880-3.c: New. + * gcc.target/sh/pr49880-4.c: New. + * gcc.target/sh/pr49880-5.c: New. + +2013-03-13 Paolo Carlini + + * g++.dg/cpp0x/alias-decl-32.C: Remove redundant bits. + +2013-03-13 Richard Biener + + PR tree-optimization/56608 + * gcc.dg/vect/fast-math-bb-slp-call-3.c: New testcase. + +2013-03-13 Paolo Carlini + + PR c++/56611 + * g++.dg/cpp0x/alias-decl-32.C: New. + +2013-03-11 Jan Hubicka + + PR middle-end/56571 + * gcc.c-torture/compile/pr56571.c: New testcase. + +2013-03-11 John David Anglin + + * gcc.dg/tree-ssa/vector-4.c: Add comment regarding xfail. + * gcc.dg/tree-ssa/pr55579.c: Likewise. + +2013-03-11 Dominique d'Humieres + + * gcc.dg/inline_3.c: Remove target and dg-excess-errors. + * gcc.dg/inline_4.c: Likewise. + * gcc.dg/unroll_2.c: Likewise. + * gcc.dg/unroll_3.c: Likewise. + * gcc.dg/unroll_4.c: Likewise. + +2013-03-10 John David Anglin + + PR testsuite/54119 + * gcc.dg/tree-ssa/vector-4.c: xfail on 32-bit hppa*-*-*. + + PR debug/56307 + * gcc.dg/tree-ssa/pr55579.c: xfail 32-bit hppa*-*-hpux*. + +2013-03-11 Oleg Endo + + PR target/40797 + * gcc.c-torture/compile/pr40797.c: New. + +2013-03-10 John David Anglin + + * gcc.dg/pr44194-1.c: Skip compilation on hppa*64*-*-*. + +2013-03-10 Paul Thomas + + PR fortran/56575 + * gfortran.dg/class_56.f90: New test. + +2013-03-09 Richard Sandiford + + PR middle-end/56524 + * gcc.target/mips/pr56524.c: New test. + +2013-03-08 Paolo Carlini + + PR c++/56565 + * g++.dg/cpp0x/lambda/lambda-nsdmi2.C: New. + +2013-03-08 Paolo Carlini + + PR c++/51412 + * g++.dg/cpp0x/lambda/lambda-err3.C: New. + +2013-03-08 Marek Polacek + + PR tree-optimization/56478 + * gcc.dg/torture/pr56478.c: New test. + +2013-03-08 Kai Tietz + + * gcc.c-torture/execute/builtins/builtins.exp: Add for mingw + targets linker option --allow-multiple-definition. + + * gcc.dg/pr14092-1.c: Mark intptr_t typedef to use extension. + * gcc.dg/pr24683.c: Avoid warning about casting constant string. + * gcc.dg/pr52549.c: Add LLP64 case. + * gcc.dg/pr53701.c: Use for uintptr_t typedef __UINTPTR_TYPE__. + * gcc.dg/pr56510.c: Adjust for LLP64 targets. + * gcc.dg/torture/pr51071-2.c: Likewise. + * gcc.dg/tree-ssa/vrp72.c: Likewise. + * gcc.dg/tree-ssa/vrp73.c: Likewise. + * gcc.dg/tree-ssa/vrp75.c: Likewise. + * gcc.dg/torture/pr53922.c: Skip test for mingw-targets. + * gcc.dg/weak/weak-1.c: Likewise. + * gcc.dg/weak/weak-2.c: Likewise. + * gcc.dg/weak/weak-3.c: Likewise. + * gcc.dg/weak/weak-4.c: Likewise. + * gcc.dg/weak/weak-5.c: Likewise. + * gcc.dg/weak/weak-15.c: Likewise. + * gcc.dg/weak/weak-16.c: Likewise. + + * c-c++-common/pr54486.c: Skip test for mingw-targets. + +2013-03-07 Jakub Jelinek + + PR tree-optimization/56559 + * gcc.dg/tree-ssa/reassoc-26.c: New test. + +2013-03-07 Andreas Schwab + + * gcc.dg/pr31490.c: Fix last change. + +2013-03-06 Paolo Carlini + + PR c++/56534 + * g++.dg/template/crash115.C: New. + +2013-03-06 Jakub Jelinek + + PR tree-optimization/56539 + * gcc.c-torture/compile/pr56539.c: New test. + +2013-03-06 Kai Tietz + + * gcc.dg/lto/20090914-2_0.c: Skip for mingw and cygwin targets. + * gcc.dg/lto/20091013-1_1.c: Set x64-mingw as xfail. + * gcc.dg/lto/20091013-1_2.c: Likewise. + * gcc.dg/pr31490.c: Adjust for LLP64 targets. + +2013-03-06 Eric Botcazou + + * gnat.dg/specs/aggr6.ads: New test. + +2013-03-06 Eric Botcazou + + * gnat.dg/loop_optimization15.ad[sb]: New test. + +2013-03-06 Jakub Jelinek + + PR middle-end/56548 + * gcc.dg/pr56548.c: New test. + +2013-03-06 Rainer Orth + + PR debug/53363 + * g++.dg/debug/dwarf2/thunk1.C: Skip on darwin. + +2013-03-06 Jakub Jelinek + + PR c++/56543 + * g++.dg/template/typename20.C: New test. + +2013-03-05 Jakub Jelinek + + PR debug/56510 + * gcc.dg/pr56510.c: New test. + + PR rtl-optimization/56484 + * gcc.c-torture/compile/pr56484.c: New test. + +2013-03-05 Paolo Carlini + + PR c++/56530 + * g++.dg/warn/Wsign-conversion-2.C: New. + +2013-03-05 Richard Biener + + PR tree-optimization/56270 + * gcc.dg/vect/slp-38.c: New testcase. + +2013-03-05 Jakub Jelinek + + PR rtl-optimization/56494 + * gcc.dg/pr56494.c: New test. + +2013-01-04 Eric Botcazou + + * gcc.dg/pr56424.c: New test. + +2013-03-04 Georg-Johann Lay + + * gcc.dg/pr55153.c: Add dg-require-effective-target scheduling. + * gcc.dg/pr56228.c : Skip. + +2013-03-04 Georg-Johann Lay + + PR testsuite/52641 + PR tree-optimization/52631 + * gcc.dg/tree-ssa/pr52631.c: Fix 16-bit int. + +2013-03-03 David Edelsohn + + * gcc.dg/vect/vect-82_64.c: Skip on AIX. + * gcc.dg/vect/vect-83_64.c: Same. + +2013-03-03 Mikael Morin + + PR fortran/56477 + * gfortran.dg/pointer_check_13.f90: New test. + +2013-03-03 Mikael Morin + + PR fortran/54730 + * gfortran.dg/array_constructor_42.f90: New test. + +2013-03-02 Paolo Carlini + + PR c++/52688 + * g++.dg/template/static33.C: New. + * g++.dg/template/static34.C: Likewise. + + PR c++/10291 + * g++.dg/template/static35.C: New. + +2013-03-01 Steve Ellcey + + * gcc.dg/pr56396.c: Require pic support. + +2013-03-01 Richard Biener + + PR tree-optimization/55481 + * gcc.dg/torture/pr56488.c: New testcase. + +2013-02-28 Konstantin Serebryany + Jakub Jelinek + + PR sanitizer/56454 + * g++.dg/asan/default-options-1.C (__asan_default_options): Use + no_sanitize_address attribute rather than no_address_safety_analysis. + * g++.dg/asan/sanitizer_test_utils.h + (ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS): Likewise. + * c-c++-common/asan/attrib-1.c: Test no_sanitize_address attribute + in addition to no_address_safety_analysis. + +2013-02-28 Jason Merrill + + PR c++/56481 + * g++.dg/cpp0x/constexpr-and.C: New. + +2013-02-28 Martin Jambor + + PR tree-optimization/56294 + * g++.dg/debug/pr56294.C: New test. + +2013-02-28 Marcus Shawcroft + + * g++.old-deja/g++.pt/ptrmem6.C(main): Add xfail aarch64*-*-*. + +2013-02-27 Marek Polacek + + PR rtl-optimization/56466 + * gcc.dg/pr56466.c: New test. + +2013-02-28 Naveen H.S + + * gcc.dg/tree-ssa/slsr-1.c: Allow widening multiplications. + * gcc.dg/tree-ssa/slsr-2.c: Likewise. + * gcc.dg/tree-ssa/slsr-3.c: Likewise. + +2013-02-27 Andrey Belevantsev + + PR middle-end/45472 + * gcc.dg/pr45472.c: New test. + +2013-02-26 Marek Polacek + + PR tree-optimization/56426 + * gcc.dg/pr56436.c: New test. + +2013-02-26 Jakub Jelinek + + PR tree-optimization/56448 + * gcc.c-torture/compile/pr56448.c: New test. + + PR tree-optimization/56443 + * gcc.dg/torture/pr56443.c: New test. + +2013-02-25 Richard Biener + + PR tree-optimization/56175 + * gcc.dg/tree-ssa/forwprop-24.c: New testcase. + +2013-02-24 Jakub Jelinek + + PR c++/56403 + * g++.dg/torture/pr56403.C: New test. + +2013-02-25 Catherine Moore + + Revert: + 2013-02-24 Catherine Moore + Richard Sandiford + + * gcc.target/mips/mips.exp: Add microMIPS support. + * gcc.target/mips/umips-movep-2.c: New test. + * gcc.target/mips/umips-lwp-2.c: New test. + * gcc.target/mips/umips-swp-5.c: New test. + * gcc.target/mips/umips-constraints-1.c: New test. + * gcc.target/mips/umips-lwp-3.c: New test. + * gcc.target/mips/umips-swp-6.c: New test. + * gcc.target/mips/umips-constraints-2.c: New test. + * gcc.target/mips/umips-save-restore-1.c: New test. + * gcc.target/mips/umips-lwp-4.c: New test. + * gcc.target/mips/umips-swp-7.c: New test. + * gcc.target/mips/umips-save-restore-2.c: New test. + * gcc.target/mips/umips-lwp-swp-volatile.c: New test. + * gcc.target/mips/umips-lwp-5.c: New test. + * gcc.target/mips/umips-save-restore-3.c: New test. + * gcc.target/mips/umips-lwp-6.c: New test. + * gcc.target/mips/umips-swp-1.c: New test. + * gcc.target/mips/umips-lwp-7.c: New test. + * gcc.target/mips/umips-swp-2.c: New test. + * gcc.target/mips/umips-lwp-8.c: New test. + * gcc.target/mips/umips-swp-3.c: New test. + * gcc.target/mips/umips-movep-1.c: New test. + * gcc.target/mips/umips-lwp-1.c: New test. + * gcc.target/mips/umips-swp-4.c: New test. + +2013-02-24 Catherine Moore + Richard Sandiford + + * gcc.target/mips/mips.exp: Add microMIPS support. + * gcc.target/mips/umips-movep-2.c: New test. + * gcc.target/mips/umips-lwp-2.c: New test. + * gcc.target/mips/umips-swp-5.c: New test. + * gcc.target/mips/umips-constraints-1.c: New test. + * gcc.target/mips/umips-lwp-3.c: New test. + * gcc.target/mips/umips-swp-6.c: New test. + * gcc.target/mips/umips-constraints-2.c: New test. + * gcc.target/mips/umips-save-restore-1.c: New test. + * gcc.target/mips/umips-lwp-4.c: New test. + * gcc.target/mips/umips-swp-7.c: New test. + * gcc.target/mips/umips-save-restore-2.c: New test. + * gcc.target/mips/umips-lwp-swp-volatile.c: New test. + * gcc.target/mips/umips-lwp-5.c: New test. + * gcc.target/mips/umips-save-restore-3.c: New test. + * gcc.target/mips/umips-lwp-6.c: New test. + * gcc.target/mips/umips-swp-1.c: New test. + * gcc.target/mips/umips-lwp-7.c: New test. + * gcc.target/mips/umips-swp-2.c: New test. + * gcc.target/mips/umips-lwp-8.c: New test. + * gcc.target/mips/umips-swp-3.c: New test. + * gcc.target/mips/umips-movep-1.c: New test. + * gcc.target/mips/umips-lwp-1.c: New test. + * gcc.target/mips/umips-swp-4.c: New test. + +2013-02-22 Jakub Jelinek + + PR sanitizer/56393 + * lib/asan-dg.exp (asan_link_flags): Add + -B${gccpath}/libsanitizer/asan/ to flags. + +2013-02-21 Jakub Jelinek + + PR middle-end/56420 + * gcc.dg/torture/pr56420.c: New test. + +2013-02-20 Aldy Hernandez + + PR middle-end/56108 + * gcc.dg/tm/memopt-1.c: Declare functions transaction_safe. + +2013-02-21 Martin Jambor + + PR tree-optimization/56310 + * g++.dg/ipa/pr56310.C: New test. + +2013-02-21 Janus Weil + + PR fortran/56385 + * gfortran.dg/proc_ptr_comp_37.f90: New. + +2013-02-21 Richard Biener + + PR tree-optimization/56415 + Revert + 2013-02-11 Richard Biener + + PR tree-optimization/56273 + * g++.dg/warn/Warray-bounds-6.C: New testcase. + * gcc.dg/tree-ssa/pr21559.c: Adjust. + * gcc.dg/tree-ssa/vrp17.c: Likewise. + * gcc.dg/tree-ssa/vrp18.c: Likewise. + * gcc.dg/tree-ssa/vrp23.c: Likewise. + * gcc.dg/tree-ssa/vrp24.c: Likewise. + +2013-02-21 Marek Polacek + + PR tree-optimization/56398 + * g++.dg/torture/pr56398.C: New test. + +2013-02-21 Jakub Jelinek + + PR inline-asm/56405 + * gcc.c-torture/compile/pr56405.c: New test. + +2013-02-20 Jan Hubicka + + PR tree-optimization/56265 + * testsuite/g++.dg/ipa/devirt-11.C: New testcase. + +2013-02-20 Richard Biener + + * gcc.dg/tree-ssa/forwprop-8.c: Adjust. + +2013-02-20 Richard Biener + Jakub Jelinek + + PR tree-optimization/56396 + * gcc.dg/pr56396.c: New testcase. + +2013-02-20 Paolo Carlini + + PR c++/56373 + * g++.dg/cpp0x/Wzero-as-null-pointer-constant-2.C: New. + +2013-02-19 Richard Biener + + PR tree-optimization/56384 + * gcc.dg/torture/pr56384.c: New testcase. + +2013-02-19 Jakub Jelinek + + PR tree-optimization/56350 + * gcc.dg/pr56350.c: New test. + + PR tree-optimization/56381 + * g++.dg/opt/pr56381.C: New test. + +2013-02-18 Jakub Jelinek + + PR pch/54117 + * lib/dg-pch.exp (pch-init, pch-finish, + check_effective_target_pch_supported_debug): New procs. + (dg-flags-pch): If $pch_unsupported, make tests UNSUPPORTED. + Likewise if $pch_unsupported_debug and $flags include -g. + Skip FAILs about missing *.gch file if $pch_unsupported_debug + and dg-require-effective-target pch_unsupported_debug. + * g++.dg/pch/pch.exp: Call pch-init and pch-finish. + * objc.dg/pch/pch.exp: Likewise. + * gcc.dg/pch/pch.exp: Likewise. + * gcc.dg/pch/valid-1.c: Add dg-require-effective-target + pch_unsupported_debug. + * gcc.dg/pch/valid-1.hs: Likewise. + * gcc.dg/pch/valid-1b.c: Likewise. + * gcc.dg/pch/valid-1b.hs: Likewise. + +2013-02-18 Richard Biener + + PR tree-optimization/56366 + * gcc.dg/torture/pr56366.c: New testcase. + +2013-02-18 Richard Biener + + PR middle-end/56349 + * gcc.dg/torture/pr56349.c: New testcase. + +2013-02-18 Richard Biener + + PR tree-optimization/56321 + * gcc.dg/torture/pr56321.c: New testcase. + +2013-02-16 Edgar E. Iglesias + + * gcc.dg/20020312-2.c: Define MicroBlaze PIC register + +2013-02-16 Jakub Jelinek + Dodji Seketeli + + PR asan/56330 + * c-c++-common/asan/no-redundant-instrumentation-4.c: New test file. + * c-c++-common/asan/no-redundant-instrumentation-5.c: Likewise. + * c-c++-common/asan/no-redundant-instrumentation-6.c: Likewise. + * c-c++-common/asan/no-redundant-instrumentation-7.c: Likewise. + * c-c++-common/asan/no-redundant-instrumentation-8.c: Likewise. + * c-c++-common/asan/pr56330.c: Likewise. + * c-c++-common/asan/no-redundant-instrumentation-1.c (test1): + Ensure the size argument of __builtin_memcpy is a constant. + +2013-02-15 Jonathan Wakely + Paolo Carlini + + PR c++/51242 + * g++.dg/cpp0x/enum23.C: New. + +2013-02-15 Oleg Endo + + PR target/54685 + * gcc.target/sh/pr54685.c: Fix scanning of not insn. + +2013-02-15 Vladimir Makarov + + PR rtl-optimization/56348 + * gcc.target/i386/pr56348.c: New test. + +2013-02-15 Greta Yorsh + + * gcc.target/arm/interrupt-1.c: Fix for thumb mode. + * gcc.target/arm/interrupt-2.c: Likewise. + +2013-02-15 Tobias Burnus + + PR fortran/56318 + * gcc/testsuite/gfortran.dg/matmul_9.f90: New. + +2013-02-15 Tobias Burnus + + PR fortran/53818 + * gfortran.dg/init_flag_11.f90: New. + +2013-02-14 Rainer Orth + + * gcc.dg/debug/dwarf2/pr53948.c: Allow for more whitespace. + +2013-02-14 Rainer Orth + + * gcc.dg/debug/dwarf2/pr53948.c: Allow for / and ! as comment + characters. + +2013-02-14 Dominique d'Humieres + Tobias Burnus + + PR testsuite/56138 + * gfortran.dg/allocatable_function_7.f90: New. + +2013-02-14 Jakub Jelinek + + * g++.dg/asan/dejagnu-gtest.h: Add multiple inclusion guards. + * asan_globals_test-wrapper.cc: New file. + * g++.dg/asan/asan_test.C: Use asan_globals_test-wrapper.cc + instead of asan_globals_test.cc as dg-additional-sources. + Include asan_mem_test.cc, asan_str_test.cc and asan_oob_test.cc. + * g++.dg/asan/asan_test_utils.h: Synced from upstream. Include + "sanitizer_test_utils.h" instead of + "sanitizer_common/tests/sanitizer_test_utils.h". + * g++.dg/asan/asan_str_test.cc: New file, synced from upstream. + * g++.dg/asan/asan_mem_test.cc: New file, synced from upstream. + * g++.dg/asan/asan_oob_test.cc: New file, synced from upstream. + * g++.dg/asan/asan_globals_test.cc: Synced from upstream. + * g++.dg/asan/asan_test.cc: Synced from upstream. + * g++.dg/asan/sanitizer_test_utils.h: New file, synced from upstream. + +2013-02-14 Dodji Seketeli + + Fix an asan crash + * c-c++-common/asan/memcmp-2.c: New test. + +2013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net> + + PR c++/55582 + * g++.dg/cpp0x/udlit-string-literal.h: New. + * g++.dg/cpp0x/udlit-string-literal.C: New. + +2013-02-13 Sriraman Tallam + + * g++.dg/ext/mv12-aux.C: Add directives to match mv12.C. + +2013-02-13 Vladimir Makarov + + PR target/56184 + * gcc.target/arm/pr56184.C: New test. + +2013-02-13 Jakub Jelinek + + PR c++/56302 + * g++.dg/torture/pr56302.C: New test. + * g++.dg/cpp0x/constexpr-56302.C: New test. + * c-c++-common/pr56302.c: New test. + +2013-02-13 Tobias Burnus + Rainer Orth + + PR fortran/56204 + * gfortran.dg/quad_2.f90: Use "< epsilon" instead of "==". + * gfortran.dg/quad_3.f90: Ditto. + +2013-02-13 Kostya Serebryany + + * c-c++-common/asan/strncpy-overflow-1.c: Update the test + to match the fresh asan run-time. + * c-c++-common/asan/rlimit-mmap-test-1.c: Ditto. + +2013-02-12 Dodji Seketeli + + Avoid instrumenting duplicated memory access in the same basic block + * c-c++-common/asan/no-redundant-instrumentation-1.c: New test. + * testsuite/c-c++-common/asan/no-redundant-instrumentation-2.c: + Likewise. + * testsuite/c-c++-common/asan/no-redundant-instrumentation-3.c: + Likewise. + * testsuite/c-c++-common/asan/inc.c: Likewise. + +2013-02-12 Vladimir Makarov + + PR inline-asm/56148 + * gcc.target/i386/pr56148.c: New test. + +2013-02-12 Dominique d'Humieres + Tobias Burnus + + PR testsuite/56082 + * gfortran.dg/bind_c_bool_1.f90 (sub): Change kind=4 to kind=2. + +2013-02-12 Richard Biener + + PR lto/56297 + * gcc.dg/lto/pr56297_0.c: New testcase. + * gcc.dg/lto/pr56297_0.c: Likewise. + +2013-02-12 Janus Weil + + PR fortran/46952 + * gfortran.dg/typebound_deferred_1.f90: New. + +2013-02-12 Jakub Jelinek + + PR rtl-optimization/56151 + * gcc.target/i386/pr56151.c: New test. + +2013-02-11 Sriraman Tallam + + * g++.dg/ext/mv12.C: New test. + * g++.dg/ext/mv12.h: New file. + * g++.dg/ext/mv12-aux.C: New file. + * g++.dg/ext/mv13.C: New test. + +2013-02-11 Sebastian Huber + + * lib/target-supports.exp + (check_effective_target_powerpc_eabi_ok): New. + * gcc.target/powerpc/ppc-eabi.c: Use require effective target + powerpc_eabi_ok. + * gcc.target/powerpc/ppc-sdata-1.c: Likewise. + * gcc.target/powerpc/spe-small-data-2.c: Likewise. Do not run, compile + only. + * gcc.target/powerpc/ppc-sdata-2.c: Add powerpc-*-rtems*. + * gcc.target/powerpc/pr51623.c: Likewise. + * gcc.target/powerpc/ppc-stackalign-1.c: Likewise. + * gcc.target/powerpc/ppc-ldstruct.c: Likewise. + +2013-02-11 Alexander Potapenko + Jack Howarth + Jakub Jelinek + + PR sanitizer/55617 + * g++.dg/asan/pr55617.C: Run on all targets. + +2013-02-11 Uros Bizjak + + PR rtl-optimization/56275 + * gcc.dg/pr56275.c: New test. + +2013-02-11 Richard Biener + + PR tree-optimization/56273 + * gcc.dg/tree-ssa/vrp17.c: Disable tail-merging. + +2013-02-11 Richard Biener + + PR tree-optimization/56264 + * gcc.dg/torture/pr56264.c: New testcase. + +2013-02-11 Richard Biener + + PR tree-optimization/56273 + * g++.dg/warn/Warray-bounds-6.C: New testcase. + * gcc.dg/tree-ssa/pr21559.c: Adjust. + * gcc.dg/tree-ssa/vrp17.c: Likewise. + * gcc.dg/tree-ssa/vrp18.c: Likewise. + * gcc.dg/tree-ssa/vrp23.c: Likewise. + * gcc.dg/tree-ssa/vrp24.c: Likewise. + +2013-02-09 Uros Bizjak + + * g++.dg/asan/asan_test.C: Compile with -D__NO_INLINE__ + for *-*-linux-gnu targets. + * g++.dg/asan/interception-test-1.c: Ditto. + * g++.dg/asan/interception-failure-test-1.C: Ditto. + * g++.dg/asan/interception-malloc-test-1.C: Ditto. + +2013-02-09 Paul Thomas + + PR fortran/55362 + * gfortran.dg/intrinsic_size_4.f90 : New test. + +2013-02-09 Jakub Jelinek + + PR target/56256 + * gcc.target/powerpc/pr56256.c: New test. + +2013-02-08 Ian Lance Taylor + + * lib/go.exp: Load timeout.exp. + +2013-02-08 Vladimir Makarov + + PR rtl-optimization/56246 + * gcc.target/i386/pr56246.c: New test. + +2013-02-08 Jeff Law + + PR debug/53948 + * gcc.dg/debug/dwarf2/pr53948.c: New test. + +2013-02-08 Michael Meissner + + PR target/56043 + * gcc.target/powerpc/vsx-mass-1.c: Only run this test on + powerpc*-*-linux*. + +2013-02-08 Edgar E. Iglesias + + * 20101011-1.c: Add __MICROBLAZE__ exception to set DO_TEST 0 + +2013-02-08 Jakub Jelinek + + PR rtl-optimization/56195 + * gcc.dg/torture/pr56195.c: New test. + +2013-02-08 Mikael Morin + + PR fortran/54107 + * gfortran.dg/recursive_interface_2.f90: New test. + +2013-02-08 Jakub Jelinek + + PR tree-optimization/56250 + * gcc.c-torture/execute/pr56250.c: New test. + +2013-02-08 Georg-Johann Lay + + PR tree-optimization/56064 + * gcc.dg/fixed-point/view-convert-2.c: New test. + +2013-02-08 Michael Matz + + PR tree-optimization/52448 + * gcc.dg/pr52448.c: New test. + +2013-02-08 Richard Biener + + PR middle-end/56181 + * gcc.dg/torture/pr56181.c: New testcase. + +2013-02-08 Georg-Johann Lay + + PR target/54222 + * gcc.target/avr/torture/builtins-4-roundfx.c: New test. + * gcc.target/avr/torture/builtins-5-countlsfx.c: New test. + +2013-02-07 Jakub Jelinek + + PR c++/56241 + * g++.dg/parse/crash61.C: New test. + + PR c++/56239 + * g++.dg/parse/pr56239.C: New test. + + PR c++/56237 + * g++.dg/abi/mangle61.C: New test. + +2013-02-07 Vladimir Makarov + + PR rtl-optimization/56225 + * gcc.target/i386/pr56225.c: New test. + +2013-02-07 Jakub Jelinek + + PR debug/56154 + * gcc.dg/guality/pr56154-1.c: New test. + * gcc.dg/guality/pr56154-2.c: New test. + * gcc.dg/guality/pr56154-3.c: New test. + * gcc.dg/guality/pr56154-4.c: New test. + * gcc.dg/guality/pr56154-aux.c: New file. + + PR tree-optimization/55789 + * g++.dg/ipa/inline-3.C: Use cleanup-ipa-dump instead of + cleanup-tree-dump. + * gcc.dg/tree-ssa/inline-3.c: Add + --param max-early-inliner-iterations=2 option. + +2013-02-07 Rainer Orth + + PR debug/53363 + * g++.dg/debug/dwarf2/thunk1.C: Restrict to 32-bit x86. + Add -fno-dwarf2-cfi-asm to dg-options. + Adapt match count. + +2013-02-07 Jakub Jelinek + + PR target/56228 + * gcc.dg/pr56228.c: New test. + +2013-02-07 Alan Modra + + PR target/54009 + * gcc.target/powerpc/pr54009.c: New test. + PR target/54131 + * gfortran.dg/pr54131.f: New test. + +2013-02-06 Paul Thomas + + PR fortran/55789 + * gfortran.dg/array_constructor_41.f90: New test. + +2013-02-06 Janus Weil + + PR fortran/55978 + * gfortran.dg/class_optional_2.f90: Uncomment some cases + which work now. + +2013-02-06 Jakub Jelinek + + PR middle-end/56217 + * g++.dg/gomp/pr56217.C: New test. + +2013-02-05 Jakub Jelinek + + PR tree-optimization/56205 + * gcc.dg/tree-ssa/stdarg-6.c: New test. + * gcc.c-torture/execute/pr56205.c: New test. + +2013-02-05 Richard Biener + + PR tree-optimization/53342 + PR tree-optimization/53185 + * gcc.dg/vect/pr53185-2.c: New testcase. + +2013-02-05 Jan Hubicka + + PR tree-optimization/55789 + * g++.dg/tree-ssa/inline-1.C: Update max-inliner-iterations. + * g++.dg/tree-ssa/inline-2.C: Update max-inliner-iterations. + * g++.dg/tree-ssa/inline-3.C: Update max-inliner-iterations. + * g++.dg/ipa/inline-1.C: New testcase. + * g++.dg/ipa/inline-2.C: New testcase. + * g++.dg/ipa/inline-3.C: New testcase. + +2013-02-05 Jan Hubicka + + PR tree-optimization/55789 + * g++.dg/torture/pr55789.C: New testcase. + +2013-02-05 Jakub Jelinek + + PR middle-end/56167 + * gcc.dg/pr56167.c: New test. + +2013-02-04 Oleg Endo + + PR target/55146 + * gcc.target/sh/pr55146.c: New. + +2013-02-04 Oleg Endo + + PR tree-optimization/54386 + * gcc.target/sh/pr54386.c: New. + +2013-02-04 Paul Thomas + + PR fortran/56008 + * gfortran.dg/realloc_on _assign_16.f90 : New test. + + PR fortran/47517 + * gfortran.dg/realloc_on _assign_17.f90 : New test. + +2013-02-04 Alexander Potapenko + Jack Howarth + Jakub Jelinek + + PR sanitizer/55617 + * g++.dg/asan/pr55617.C: New test. + +2013-02-04 Mikael Morin + + PR fortran/54195 + * gfortran.dg/typebound_operator_19.f90: New test. + * gfortran.dg/typebound_assignment_4.f90: New test. + +2013-02-04 Mikael Morin + + PR fortran/54107 + * gfortran.dg/recursive_interface_1.f90: New test. + +2013-02-04 Richard Guenther + + PR lto/56168 + * gcc.dg/lto/pr56168_0.c: New testcase. + * gcc.dg/lto/pr56168_1.c: Likewise. + +2013-02-02 Thomas Koenig + + PR fortran/50627 + PR fortran/56054 + * gfortran.dg/block_12.f90: New test. + * gfortran.dg/module_error_1.f90: New test. + +2013-02-02 Richard Sandiford + + * lib/target-supports.exp (check_effective_target_vect_float) + (check_effective_target_vect_no_align): Add mips-sde-elf. + +2013-02-01 Jakub Jelinek + + * lib/gcc-dg.exp (restore-target-env-var): Avoid using lreverse. + +2013-02-01 David Edelsohn + + * gcc.dg/pr56023.c: XFAIL on AIX. + * gcc.dg/vect/pr49352.c: Same. + +2013-02-01 Eric Botcazou + + * gnat.dg/opt26.adb: New test. + +2013-01-31 Ramana Radhakrishnan + + Revert. + 2013-01-27 Amol Pise + + * gcc.target/arm/neon-vfnms-1.c: New test. + * gcc.target/arm/neon-vfnma-1.c: New test. + +2013-01-31 Richard Biener + + PR tree-optimization/56157 + * gcc.dg/torture/pr56157.c: New testcase. + +2013-01-30 Richard Biener + + PR tree-optimization/56150 + * gcc.dg/torture/pr56150.c: New testcase. + +2013-01-30 Jakub Jelinek + + PR sanitizer/55374 + * g++.dg/asan/large-func-test-1.C: Allow both _Zna[jm] in addition + to _Znw[jm] in the backtrace. Allow _Zna[jm] to be the first frame + printed in backtrace. + * g++.dg/asan/deep-stack-uaf-1.C: Use malloc instead of operator new + to avoid errors about mismatched allocation vs. deallocation. + + PR c++/55742 + * g++.dg/mv1.C: Moved to... + * g++.dg/ext/mv1.C: ... here. Adjust test. + * g++.dg/mv2.C: Moved to... + * g++.dg/ext/mv2.C: ... here. Adjust test. + * g++.dg/mv3.C: Moved to... + * g++.dg/ext/mv3.C: ... here. + * g++.dg/mv4.C: Moved to... + * g++.dg/ext/mv4.C: ... here. + * g++.dg/mv5.C: Moved to... + * g++.dg/ext/mv5.C: ... here. Adjust test. + * g++.dg/mv6.C: Moved to... + * g++.dg/ext/mv6.C: ... here. Adjust test. + * g++.dg/ext/mv7.C: New test. + * g++.dg/ext/mv8.C: New test. + * g++.dg/ext/mv9.C: New test. + * g++.dg/ext/mv10.C: New test. + * g++.dg/ext/mv11.C: New test. + +2013-01-30 Vladimir Makarov + + PR rtl-optimization/56144 + * gcc.dg/pr56144.c: New. + +2013-01-30 David Edelsohn + + * g++.dg/cpp0x/constexpr-53094-2.C: Ignore non-standard ABI + message. + * g++.dg/cpp0x/constexpr-53094-3.C: Same. + * g++.dg/cpp0x/constexpr-55573.C: Same + +2013-01-30 Georg-Johann Lay + + PR tree-optimization/56064 + * gcc.dg/fixed-point/view-convert.c: New test. + +2013-01-30 Andreas Schwab + + * lib/target-supports-dg.exp (dg-process-target): Use expr to + evaluate the end index in string range. + +2013-01-30 Tobias Burnus + + PR fortran/56138 + * gfortran.dg/allocatable_function_6.f90: New. + +2013-01-29 Janus Weil + Mikael Morin + + PR fortran/54107 + * gfortran.dg/proc_ptr_comp_36.f90: New. + +2013-01-29 Richard Biener + + PR tree-optimization/55270 + * gcc.dg/torture/pr55270.c: New testcase. + +2013-01-28 Jakub Jelinek + + PR rtl-optimization/56117 + * gcc.dg/pr56117.c: New test. + +2013-01-28 Richard Biener + + PR tree-optimization/56034 + * gcc.dg/torture/pr56034.c: New testcase. + +2013-01-28 Jakub Jelinek + + PR tree-optimization/56125 + * gcc.dg/pr56125.c: New test. + +2013-01-28 Tobias Burnus + Mikael Morin + + PR fortran/53537 + * gfortran.dg/import2.f90: Adjust undeclared type error messages. + * gfortran.dg/import8.f90: Likewise. + * gfortran.dg/interface_derived_type_1.f90: Likewise. + * gfortran.dg/import10.f90: New test. + * gfortran.dg/import11.f90: Likewise + +2013-01-28 Jakub Jelinek + + PR testsuite/56053 + * c-c++-common/asan/heap-overflow-1.c: Don't include stdlib.h and + string.h. Provide memset, malloc and free prototypes, adjust line + numbers in dg-output. + * c-c++-common/asan/stack-overflow-1.c: Don't include string.h. + Provide memset prototype and adjust line numbers in dg-output. + * c-c++-common/asan/global-overflow-1.c: Likewise. + + PR tree-optimization/56094 + * gcc.dg/pr56094.c: New test. + +2013-01-27 Amol Pise + + * gcc.target/arm/neon-vfnms-1.c: New test. + * gcc.target/arm/neon-vfnma-1.c: New test. + +2013-01-27 Uros Bizjak + + PR target/56114 + * gcc.target/i386/pr56114.c: New test. + +2013-01-27 Paul Thomas + + PR fortran/55984 + * gfortran.dg/associate_14.f90: New test. + + PR fortran/56047 + * gfortran.dg/associate_13.f90: New test. + +2013-01-25 Jakub Jelinek + + PR tree-optimization/56098 + * gcc.dg/pr56098-1.c: New test. + * gcc.dg/pr56098-2.c: New test. + +2013-01-25 Georg-Johann Lay + + PR target/54222 + * gcc.target/avr/torture/builtins-3-absfx.c: New test. + +2013-01-22 Marek Polacek + + PR tree-optimization/56035 + * gcc.dg/pr56035.c: New test. + +2013-01-24 Richard Sandiford + + * gfortran.dg/bind_c_array_params_2.f90: Require -mno-relax-pic-calls + for MIPS. + +2013-01-24 Richard Sandiford + + * gcc.target/mips/octeon-pipe-1.c: Add -ffat-lto-objects + +2013-01-24 Jakub Jelinek + + PR c/56078 + * gcc.dg/pr56078.c: New test. + * gcc.c-torture/compile/20030305-1.c: Add dg-error lines. + +2013-01-24 Martin Jambor + + PR tree-optimization/55927 + * g++.dg/ipa/devirt-10.C: Disable early inlining. + +2013-01-24 Uros Bizjak + + * gcc.target/i386/movsd.c: New test. + +2013-01-24 Steven Bosscher + + PR inline-asm/55934 + * gcc.target/i386/pr55934.c: New test. + +2013-01-23 Janus Weil + + PR fortran/56081 + * gfortran.dg/select_8.f90: New. + +2013-01-23 David Holsgrove + + * gcc.target/microblaze/microblaze.exp: Remove + target_config_cflags check. + +2013-01-23 Jakub Jelinek + + PR fortran/56052 + * gfortran.dg/gomp/pr56052.f90: New test. + + PR target/49069 + * gcc.dg/pr49069.c: New test. + +2013-01-22 Paolo Carlini + + PR c++/55944 + * g++.dg/cpp0x/constexpr-static10.C: New. + +2013-01-22 Uros Bizjak + + PR target/56028 + * gcc.target/i386/pr56028.c: New test. + +2013-01-22 Jakub Jelinek + + PR target/55686 + * gcc.target/i386/pr55686.c: New test. + +2013-01-22 Dodji Seketeli + + PR c++/53609 + * g++.dg/cpp0x/variadic139.C: New test. + * g++.dg/cpp0x/variadic140.C: Likewise. + * g++.dg/cpp0x/variadic141.C: Likewise. + +2013-01-22 Eric Botcazou + + * gnat.dg/warn8.adb: New test. + +2013-01-21 Thomas Koenig + + PR fortran/55919 + * gfortran.dg/include_8.f90: New test. + +2013-01-21 Uros Bizjak + + * gcc.dg/tree-ssa/pr55579.c: Cleanup esra tree dump. + * gfortran.dg/unlimited_polymorphic_8.f90: Cleanup original tree dump. + +2013-01-21 Jakub Jelinek + + PR tree-optimization/56051 + * gcc.c-torture/execute/pr56051.c: New test. + +2013-01-21 Uros Bizjak + + PR rtl-optimization/56023 + * gcc.dg/pr56023.c: New test. + +2013-01-21 Martin Jambor + + PR middle-end/56022 + * gcc.target/i386/pr56022.c: New test. + +2013-01-21 Jason Merrill + + * lib/target-supports.exp (check_effective_target_alias): New. + +2013-01-20 Jack Howarth + + PR debug/53235 + * g++.dg/debug/dwarf2/nested-4.C: XFAIL on darwin. + +2013-01-20 Hans-Peter Nilsson + + * gfortran.dg/inquire_10.f90: Run only for non-newlib targets. + +2013-01-19 Jeff Law + + PR tree-optimization/52631 + * tree-ssa/pr52631.c: New test. + * tree-ssa/ssa-fre-9: Update expected output. + +2013-01-19 Anthony Green + + * gcc.dg/tree-ssa/asm-2.c (REGISTER): Pick an appropriate register + for moxie. + +2013-01-18 Jakub Jelinek + + PR tree-optimization/56029 + * g++.dg/torture/pr56029.C: New test. + +2013-01-18 Sharad Singhai + + PR tree-optimization/55995 + * gcc.dg/vect/vect.exp: Use "details" flags for dump info. + +2013-01-18 Vladimir Makarov + + PR target/55433 + * gcc.target/i386/pr55433.c: New. + +2013-01-18 Jakub Jelinek + + PR middle-end/56015 + * gfortran.dg/pr56015.f90: New test. + +2013-01-18 Janis Johnson + + * gcc.dg/vect/vect-multitypes-12.c: Refactor dg-final directive. + +2013-01-18 James Greenhalgh + + * gcc.target/aarch64/vect-fcm-gt-f.c: Change expected output. + * gcc.target/aarch64/vect-fcm-gt-d.c: Likewise. + * gcc.target/aarch64/vect-fcm-ge-f.c: Likewise. + * gcc.target/aarch64/vect-fcm-ge-d.c: Likewise. + * gcc.target/aarch64/vect-fcm-eq-f.c: Likewise. + +2013-01-17 Jeff Law + + * gcc.dg/pr52573.c: Move to... + * gcc.target/m68k/pr52573.c: Here. Eliminate target selector. + + PR rtl-optimization/52573 + * gcc.dg/pr52573.c: New test. + +2013-01-17 Jack Howarth + + PR sanitizer/55679 + * g++.dg/asan/interception-test-1.C: Skip on darwin. + * lib/target-supports.exp (check_effective_target_swapcontext): Use + check_no_compiler_messages to test support in ucontext.h. + (check_effective_target_setrlimit): Return 0 for Darwin's non-posix + compliant RLIMIT_AS. + +2013-01-17 Marek Polacek + + PR rtl-optimization/55833 + * gcc.dg/pr55833.c: New test. + +2013-01-17 Jan Hubicka + + PR tree-optimization/55273 + * gcc.c-torture/compile/pr55273.c: New testcase. + +2013-01-17 Uros Bizjak + + PR target/55981 + * gcc.target/pr55981.c: New test. + +2013-01-17 Janis Johnson + + * gcc.target/arm/pr40887.c: Require at least armv5. + * gcc.target/arm/pr51835.c: Avoid conflicts with multilib flags. + * gcc.target/arm/pr51915.c: Likewise. + * gcc.target/arm/pr52006.c: Likewise. + * gcc.target/arm/pr53187.c: Likewise. + + * gcc.target/arm/ftest-support.h: Replace for compile-only tests. + * gcc.target/arm/ftest-support-arm.h: Delete. + * gcc.target/arm/ftest-support-thumb.h: Delete. + * gcc.target/arm/ftest-armv4-arm.c: Replace with compile-only test. + * gcc.target/arm/ftest-armv4t-arm.c: Likewise. + * gcc.target/arm/ftest-armv4t-thumb.c: Likewise. + * gcc.target/arm/ftest-armv5t-arm.c: Likewise. + * gcc.target/arm/ftest-armv5t-thumb.c: Likewise. + * gcc.target/arm/ftest-armv5te-arm.c: Likewise. + * gcc.target/arm/ftest-armv5te-thumb.c: Likewise. + * gcc.target/arm/ftest-armv6-arm.c: Likewise. + * gcc.target/arm/ftest-armv6-thumb.c: Likewise. + * gcc.target/arm/ftest-armv6k-arm.c: Likewise. + * gcc.target/arm/ftest-armv6k-thumb.c: Likewise. + * gcc.target/arm/ftest-armv6m-thumb.c: Likewise. + * gcc.target/arm/ftest-armv6t2-arm.c: Likewise. + * gcc.target/arm/ftest-armv6t2-thumb.c: Likewise. + * gcc.target/arm/ftest-armv6z-arm.c: Likewise. + * gcc.target/arm/ftest-armv6z-thumb.c: Likewise. + * gcc.target/arm/ftest-armv7a-arm.c: Likewise. + * gcc.target/arm/ftest-armv7a-thumb.c: Likewise. + * gcc.target/arm/ftest-armv7em-thumb.c: Likewise. + * gcc.target/arm/ftest-armv7m-thumb.c: Likewise. + * gcc.target/arm/ftest-armv7r-arm.c: Likewise. + * gcc.target/arm/ftest-armv7r-thumb.c: Likewise. + * gcc.target/arm/ftest-armv8a-arm.c: Likewise. + * gcc.target/arm/ftest-armv8a-thumb.c: Likewise. + +2013-01-17 Martin Jambor + + PR tree-optimizations/55264 + * g++.dg/ipa/pr55264.C: New test. + +2013-01-16 Janus Weil + + PR fortran/55983 + * gfortran.dg/class_55.f90: New. + +2013-01-16 Janis Johnson + + PR testsuite/55994 + * gcc.c-torture/execute/builtins/builtins.exp: Add + -Wl,--allow-multiple-definition for eabi and elf targets. + + PR testsuite/54622 + * lib/target-supports.exp (check_effective_target_vect_perm_byte, + check_effective_target_vect_perm_short, + check_effective_target_vect_widen_mult_qi_to_hi_pattern, + check_effective_target_vect64): Return 0 for big-endian ARM. + (check_effective_target_vect_widen_sum_qi_to_hi): Return 1 for ARM. + + * gcc.target/arm/neon-vld1_dupQ.c: Use types that match function + prototypes. + +2013-01-16 Richard Biener + + PR tree-optimization/55964 + * gcc.dg/torture/pr55964.c: New testcase. + +2013-01-16 Richard Biener + + PR tree-optimization/54767 + PR tree-optimization/53465 + * gfortran.fortran-torture/execute/pr54767.f90: New testcase. + +2013-01-16 Christian Bruel + + PR target/55301 + * gcc.target/sh/sh-switch.c: New testcase. + +2013-01-15 Janis Johnson + + * gcc.dg/webizer.c: Increase the array size. + +2013-01-15 Jakub Jelinek + + PR target/55940 + * gcc.dg/pr55940.c: New test. + +2013-01-15 Manfred Schwarb + Harald Anlauf + + * gfortran.dg/bounds_check_4.f90: Add dg-options "-fbounds-check". + * gfortran.dg/bounds_check_5.f90: Likewise. + * gfortran.dg/class_array_10.f03: Fix syntax of dg-directive. + * gfortran.dg/continuation_9.f90: Likewise. + * gfortran.dg/move_alloc_13.f90: Likewise. + * gfortran.dg/structure_constructor_11.f90: Likewise. + * gfortran.dg/tab_continuation.f: Likewise. + * gfortran.dg/warning-directive-2.F90: Likewise. + * gfortran.dg/coarray_lib_token_4.f90: Remove misspelled directive. + +2013-01-15 Janis Johnson + + * gcc.target/arm/fma.c: Skip for conflicting multilib options. + * gcc.target/arm/fma-sp.c: Likewise. + +2013-01-15 Vladimir Makarov + + PR rtl-optimization/55153 + * gcc.dg/pr55153.c: New. + +2013-01-15 Jakub Jelinek + + PR tree-optimization/55920 + * gcc.c-torture/compile/pr55920.c: New test. + +2013-01-15 Richard Biener + + PR middle-end/55882 + * gcc.dg/torture/pr55882.c: New testcase. + +2013-01-15 Jakub Jelinek + + PR tree-optimization/55955 + * gcc.c-torture/compile/pr55955.c: New test. + +2013-01-15 Dodji Seketeli + + PR c++/55663 + * g++.dg/cpp0x/alias-decl-31.C: New test. + +2013-01-15 Paul Thomas + + PR fortran/54286 + * gfortran.dg/proc_ptr_result_8.f90 : Add module 'm' to check + case where interface is null. + +2013-01-14 Thomas Koenig + + PR fortran/55806 + * gfortran.dg/array_constructor_40.f90: New test. + +2013-01-14 Richard Sandiford + + * gcc.dg/tree-ssa/slsr-8.c: Allow widening multiplications. + +2013-01-14 Tejas Belagod + + * gcc.target/aarch64/aarch64/vect-ld1r-compile-fp.c: New. + * gcc.target/aarch64/vect-ld1r-compile.c: New. + * gcc.target/aarch64/vect-ld1r-fp.c: New. + * gcc.target/aarch64/vect-ld1r.c: New. + * gcc.target/aarch64/vect-ld1r.x: New. + +2013-01-14 Andi Kleen + + PR target/55948 + * gcc.target/i386/hle-clear-rel.c: New file + * gcc.target/i386/hle-store-rel.c: New file. + +2013-01-14 Harald Anlauf + + * gfortran.dg/aint_anint_1.f90: Add dg-do run. + * gfortran.dg/bounds_check_4.f90: Likewise. + * gfortran.dg/inquire_10.f90: Likewise. + * gfortran.dg/minloc_3.f90: Likewise. + * gfortran.dg/minlocval_3.f90: Likewise. + * gfortran.dg/module_double_reuse.f90: Likewise. + * gfortran.dg/mvbits_1.f90: Likewise. + * gfortran.dg/oldstyle_1.f90: Likewise. + * gfortran.dg/pr20163-2.f: Likewise. + * gfortran.dg/save_1.f90: Likewise. + * gfortran.dg/scan_1.f90: Likewise. + * gfortran.dg/select_char_1.f90: Likewise. + * gfortran.dg/shape_4.f90: Likewise. + * gfortran.dg/coarray_29_2.f90: Fix dg-do directive. + * gfortran.dg/function_optimize_10.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.11.2.f90: Likewise. + * gfortran.dg/used_types_17.f90: Likewise. + * gfortran.dg/used_types_18.f90: Likewise. + +2013-01-13 Paul Thomas + + PR fortran/54286 + * gfortran.dg/proc_ptr_result_8.f90 : New test. + +2013-01-13 Richard Sandiford + + * gcc.dg/unroll_5.c: Add nomips16 attributes. + +2013-01-13 Richard Sandiford + + * gcc.dg/tree-ssa/ssa-dom-thread-4.c: Update expected results for MIPS. + +2013-01-12 Janus Weil + + PR fortran/55072 + * gfortran.dg/assumed_type_2.f90: Fix test case. + * gfortran.dg/internal_pack_13.f90: New test. + * gfortran.dg/internal_pack_14.f90: New test. + +2013-01-08 Paul Thomas + + PR fortran/55868 + * gfortran.dg/unlimited_polymorphic_8.f90: Update + scan-tree-dump-times for foo.0.x._vptr to deal with change from + $tar to STAR. + +2013-01-11 Andreas Schwab + + * gcc.c-torture/compile/pr55921.c: Don't use matching constraints. + +2013-01-11 Andreas Krebbel + + PR target/55719 + * gcc.target/s390/pr55719.c: New testcase. + +2013-01-11 Richard Guenther + + PR tree-optimization/44061 + * gcc.dg/pr44061.c: New testcase. + +2013-01-10 Richard Sandiford + + Update copyright years. + +2013-01-10 Aldy Hernandez + Jakub Jelinek + + PR target/55565 + * gcc.target/powerpc/ppc-mov-1.c: Update scan-assembler-not regex. + +2013-01-10 Vladimir Makarov + + PR rtl-optimization/55672 + * gcc.target/i386/pr55672.c: New. + +2013-01-10 Jeff Law + + * gcc/dg/tree-ssa/vrp06.c: Tighten expected output. Make each + pass/fail message unique. + + +2013-01-10 Jason Merrill + + * ada/.gitignore: New. + +2013-01-10 Rainer Orth + + * g++.dg/tls/thread_local-cse.C: Don't xfail on *-*-solaris2.9. + Add tls options. + * g++.dg/tls/thread_local2.C: Likewise. + * g++.dg/tls/thread_local2g.C: Likewise. + * g++.dg/tls/thread_local6.C: Likewise. + * g++.dg/tls/thread_local-order1.C: Add tls options. + * g++.dg/tls/thread_local-order2.C: Likewise. + * g++.dg/tls/thread_local3.C: Likewise. + * g++.dg/tls/thread_local3g.C: Likewise. + * g++.dg/tls/thread_local4.C: Likewise. + * g++.dg/tls/thread_local4g.C: Likewise. + * g++.dg/tls/thread_local5.C: Likewise. + * g++.dg/tls/thread_local5g.C: Likewise. + * g++.dg/tls/thread_local6g.C: Likewise. + +2013-01-10 Kostya Serebryany + + * g++.dg/asan/asan_test.cc: Sync from upstream. + +2013-01-10 Jakub Jelinek + + PR tree-optimization/55921 + * gcc.c-torture/compile/pr55921.c: New test. + +2013-01-09 Jan Hubicka + + PR tree-optimization/55569 + * gcc.c-torture/compile/pr55569.c: New testcase. + +2013-01-09 Mikael Morin + + PR fortran/47203 + * gfortran.dg/use_28.f90: New test. + +2013-01-09 Uros Bizjak + + * gfortran.dg/intrinsic_size_3.f90: Make scan-tree-dump-times + number matching more robust. + +2013-01-09 Vladimir Makarov + + PR rtl-optimization/55829 + * gcc.target/i386/pr55829.c: New. + +2013-01-09 Tobias Burnus + + PR fortran/55758 + * gfortran.dg/bind_c_bool_1.f90: New. + * gfortran.dg/do_5.f90: Add dg-warning. + +2013-01-09 Jan Hubicka + + PR tree-optimization/55875 + * gcc.c-torture/execute/pr55875.c: New testcase. + * g++.dg/torture/pr55875.C: New testcase. + +2013-01-09 Jakub Jelinek + + PR c/48418 + * c-c++-common/pr48418.c: New test. + +2013-01-09 Paolo Carlini + + PR c++/55801 + * g++.dg/tls/thread_local-ice.C: New. + +2013-01-09 Andreas Schwab + + * gcc.dg/guality/pr54693.c: Null-terminate arr. + +2013-01-09 Jakub Jelinek + + PR tree-optimization/48189 + * gcc.dg/pr48189.c: New test. + +2013-01-04 Jan Hubicka + + PR tree-optimization/55823 + * g++.dg/ipa/devirt-10.C: New testcase. + +2013-01-08 Uros Bizjak + Vladimir Yakovlev + + PR rtl-optimization/55845 + * gcc.target/i386/pr55845.c: New test. + +2013-01-08 Tejas Belagod + + * gcc.target/aarch64/vect-mull-compile.c: Explicitly scan for + instructions generated instead of number of occurances. + +2013-01-08 James Greenhalgh + + * gcc.target/aarch64/vect-fcm-eq-d.c: New. + * gcc.target/aarch64/vect-fcm-eq-f.c: Likewise. + * gcc.target/aarch64/vect-fcm-ge-d.c: Likewise. + * gcc.target/aarch64/vect-fcm-ge-f.c: Likewise. + * gcc.target/aarch64/vect-fcm-gt-d.c: Likewise. + * gcc.target/aarch64/vect-fcm-gt-f.c: Likewise. + * gcc.target/aarch64/vect-fcm.x: Likewise. + * lib/target-supports.exp + (check_effective_target_vect_cond): Enable for AArch64. + +2013-01-08 James Greenhalgh + + * gcc.target/aarch64/vsqrt.c (test_square_root_v2sf): Use + endian-safe float pool loading. + (test_square_root_v4sf): Likewise. + (test_square_root_v2df): Likewise. + * lib/target-supports.exp + (check_effective_target_vect_call_sqrtf): Add AArch64. + +2013-01-08 Martin Jambor + + PR debug/55579 + * gcc.dg/tree-ssa/pr55579.c: New test. + +2013-01-08 Rainer Orth + + * g++.dg/debug/dwarf2/pr54508.C: Allow for more whitespace after + asm comments. + +2013-01-08 Jakub Jelinek + + PR middle-end/55890 + * gcc.dg/torture/pr55890-3.c: New test. + + PR middle-end/55851 + * gcc.c-torture/compile/pr55851.c: New test. + + PR sanitizer/55844 + * c-c++-common/asan/null-deref-1.c: Add -fno-shrink-wrap to + dg-options. + +2013-01-08 Paul Thomas + + PR fortran/55618 + * gfortran.dg/elemental_scalar_args_2.f90: New test. + +2013-01-07 Tobias Burnus + + PR fortran/55763 + * gfortran.dg/pointer_init_2.f90: Update dg-error. + * gfortran.dg/pointer_init_7.f90: New. + +2013-01-07 Richard Biener + + * gcc.dg/lto/pr55525_0.c (s): Size like char *. + +2013-01-07 Richard Biener + + PR middle-end/55890 + * gcc.dg/torture/pr55890-1.c: New testcase. + * gcc.dg/torture/pr55890-2.c: Likewise. + +2013-01-07 James Greenhalgh + + * gcc.target/aarch64/fmovd.c: New. + * gcc.target/aarch64/fmovf.c: Likewise. + * gcc.target/aarch64/fmovd-zero.c: Likewise. + * gcc.target/aarch64/fmovf-zero.c: Likewise. + * gcc.target/aarch64/vect-fmovd.c: Likewise. + * gcc.target/aarch64/vect-fmovf.c: Likewise. + * gcc.target/aarch64/vect-fmovd-zero.c: Likewise. + * gcc.target/aarch64/vect-fmovf-zero.c: Likewise. + +2013-01-07 Richard Biener + + PR tree-optimization/55888 + PR tree-optimization/55862 + * gcc.dg/torture/pr55888.c: New testcase. + +2013-01-07 Tobias Burnus + + PR fortran/55852 + * gfortran.dg/intrinsic_size_3.f90: New. + +2013-01-07 Tobias Burnus + + PR fortran/55763 + * gfortran.dg/select_type_32.f90: New. + +2013-01-04 Dodji Seketeli + + PR c++/52343 + * g++.dg/cpp0x/alias-decl-29.C: New test. + +2013-01-06 Paul Thomas + + PR fortran/53876 + PR fortran/54990 + PR fortran/54992 + * gfortran.dg/class_array_15.f03: New test. + +2013-01-06 Mikael Morin + + PR fortran/42769 + PR fortran/45836 + PR fortran/45900 + * gfortran.dg/use_23.f90: New test. + * gfortran.dg/use_24.f90: New test. + * gfortran.dg/use_25.f90: New test. + * gfortran.dg/use_26.f90: New test. + * gfortran.dg/use_27.f90: New test. + +2013-01-06 Olivier Hainque + + * gnat.dg/specs/clause_on_volatile.ads: New test. + +2013-01-06 Eric Botcazou + + * gnat.dg/alignment10.adb: New test. + +2013-01-05 Steven G. Kargl + Mikael Morin + + PR fortran/55827 + * gfortran.dg/use_22.f90: New test. + +2013-01-04 Andrew Pinski + + * gcc.target/aarch64/cmp-1.c: New testcase. + +2013-01-04 Paul Thomas + + PR fortran/55172 + * gfortran.dg/select_type_31.f03: New test. + +2013-01-04 Paolo Carlini + + PR c++/54526 (again) + * g++.dg/cpp0x/parse2.C: Extend. + * g++.old-deja/g++.other/crash28.C: Adjust. + +2013-01-04 Richard Biener + + PR tree-optimization/55862 + * gcc.dg/torture/pr55862.c: New testcase. + +2013-01-04 Martin Jambor + + PR tree-optimization/55755 + * gcc.dg/torture/pr55755.c: New test. + * gcc.dg/tree-ssa/sra-13.c: Likewise. + * gcc.dg/tree-ssa/pr45144.c: Update. + +2013-01-04 Richard Biener + + PR middle-end/55863 + * gcc.dg/fold-reassoc-2.c: New testcase. + +2013-01-04 Tobias Burnus + + PR fortran/55763 + * gfortran.dg/null_7.f90: New. + +2013-01-04 Tobias Burnus + + PR fortran/55854 + PR fortran/55763 + * gfortran.dg/unlimited_polymorphic_3.f03: Remove invalid code. + * gfortran.dg/unlimited_polymorphic_7.f90: New. + * gfortran.dg/unlimited_polymorphic_8.f90: New. + +2013-01-03 Richard Sandiford + + * gcc.dg/torture/tls/tls-reload-1.c (main): Make testing more thorough. + +2013-01-03 Janus Weil + + PR fortran/55855 + * gfortran.dg/assignment_1.f90: Modified. + * gfortran.dg/assignment_4.f90: New. + +2013-01-03 David Edelsohn + + * gcc.dg/torture/tls/tls-reload-1.c: Add tls options. + +2013-01-03 Richard Biener + + PR tree-optimization/55857 + * gcc.dg/vect/pr55857-1.c: New testcase. + * gcc.dg/vect/pr55857-2.c: Likewise. + +2013-01-03 Jakub Jelinek + + PR rtl-optimization/55838 + * gcc.dg/pr55838.c: New test. + + PR tree-optimization/55832 + * gcc.c-torture/compile/pr55832.c: New test. + +2013-01-02 Teresa Johnson + + * gcc.dg/tree-ssa/loop-1.c: Update expected dump message. + * gcc.dg/tree-ssa/loop-23.c: Ditto. + * gcc.dg/tree-ssa/cunroll-1.c: Ditto. + * gcc.dg/tree-ssa/cunroll-2.c: Ditto. + * gcc.dg/tree-ssa/cunroll-3.c: Ditto. + * gcc.dg/tree-ssa/cunroll-4.c: Ditto. + * gcc.dg/tree-ssa/cunroll-5.c: Ditto. + * gcc.dg/unroll_1.c: Ditto. + * gcc.dg/unroll_2.c: Ditto. + * gcc.dg/unroll_3.c: Ditto. + * gcc.dg/unroll_4.c: Ditto. + +2013-01-02 John David Anglin + + * gcc.dg/pr55430.c: Define MAP_FAILED if not defined. + +2013-01-02 Jerry DeLisle + + PR fortran/55818 + * gfortran.dg/eof_4.f90: New test. + +2013-01-02 Jakub Jelinek + + * lib/c-compat.exp (compat-use-alt-compiler): Remove + -fno-diagnostics-show-caret from TEST_ALWAYS_FLAGS if needed. + (compat-use-tst-compiler): Restore TEST_ALWAYS_FLAGS. + (compat_setup_dfp): Initialize compat_alt_caret and + compat_save_TEST_ALWAYS_FLAGS. + +2013-01-02 Richard Sandiford + + * gcc.dg/torture/tls/tls-reload-1.c: New test. + +2013-01-02 Richard Sandiford + + * gcc.dg/torture/fp-int-convert-2.c: New test. + +2013-01-01 Jerry DeLisle + + * gfortran.dg/newunit_3.f90: Add dg-do run. + * gfortran.dg/inquire_15.f90: Add dg-do run. + +2013-01-01 Jakub Jelinek + + PR tree-optimization/55831 + * gcc.dg/pr55831.c: New test. + +Copyright (C) 2013 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. 2013-12-31 Jakub Jelinek PR tree-optimization/59622 diff --git a/gcc-4.9/gcc/testsuite/ada/.gitignore b/gcc-4.9/gcc/testsuite/ada/.gitignore new file mode 100644 index 000000000..a499072f4 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/ada/.gitignore @@ -0,0 +1,2 @@ +# In the Ada testsuite, .a is an ada source file, not a library. +!*.a diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541-2.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541-2.c new file mode 100644 index 000000000..83325a775 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541-2.c @@ -0,0 +1,15 @@ +/* PR middle-end/57541 */ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +int foo1 () +{ + int a; + a = __sec_reduce_add (1); /* { dg-error "Invalid builtin arguments" } */ +} + +int foo2 () +{ + int a; + a = __sec_reduce_add (); /* { dg-error "Invalid builtin arguments" } */ +} diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c index 9bff07991..f379e461c 100755 --- a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c +++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr57541.c @@ -1,9 +1,10 @@ +/* PR middle-end/57541 */ /* { dg-do compile } */ /* { dg-options "-fcilkplus" } */ int A[10]; -int main () { +int foo () { /* C compiler uses the term "undeclared" whereas C++ compiler uses "not declared". Thus, grepping for declared seem to be the easiest. */ @@ -13,5 +14,13 @@ int main () { A[l:s:c]; } -/* { dg-message "note: each" "defined" { target c } 10 } */ +int foo1 (int N) { + + char c = (char)N; + short s = (short)N; + A[l:s:c]; /* { dg-error "declared" } */ +} + + +/* { dg-message "note: each" "defined" { target c } 11 } */ diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr58942.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr58942.c new file mode 100644 index 000000000..87903af3c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr58942.c @@ -0,0 +1,8 @@ +/* PR c/58942 */ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +int foo (int*p, int i) +{ + return __sec_reduce_max_ind(p[1:i]); +} diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c new file mode 100644 index 000000000..deb839218 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/AN/pr61191.c @@ -0,0 +1,10 @@ +/* PR c/61191 */ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +double f(double * A, double * B) +{ + return __sec_reduce_add((B[0:500])(; /* { dg-error "called object" "" { target c } } */ +/* { dg-error "expected expression before ';' token" "" { target c } 7 } */ +/* { dg-error "expected primary-expression before ';' token" "" { target c++ } 7 } */ +} /* { dg-error "expected" "" { target c } } */ diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_sync.cc b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_sync.cc new file mode 100644 index 000000000..cf1caf12b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/cilk-plus/CK/invalid_sync.cc @@ -0,0 +1,9 @@ +/* PR c/60189 */ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +int main (void) +{ + _Cilk_sync return; /* { dg-error " expected ';' before 'return'" } */ + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr59073.c b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr59073.c new file mode 100644 index 000000000..543ff5d34 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr59073.c @@ -0,0 +1,12 @@ +/* PR c/59073 */ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +void +foo () +{ + int i; +#pragma omp distribute parallel for + for (i = 0; i < 10; i) /* { dg-error "invalid increment expression" } */ + ; +} diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-1.c b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-1.c new file mode 100644 index 000000000..5f985724d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-1.c @@ -0,0 +1,19 @@ +/* PR tree-optimization/60823 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp-simd" } */ + +#pragma omp declare simd simdlen(4) notinbranch +int +foo (const double c1, const double c2) +{ + double z1 = c1, z2 = c2; + int res = 100, i; + + for (i = 0; i < 100; i++) + { + res = (z1 * z1 + z2 * z2 > 4.0) ? (i < res ? i : res) : res; + z1 = c1 + z1 * z1 - z2 * z2; + z2 = c2 + 2.0 * z1 * z2; + } + return res; +} diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-2.c b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-2.c new file mode 100644 index 000000000..4c8762007 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-2.c @@ -0,0 +1,44 @@ +/* PR tree-optimization/60823 */ +/* { dg-do run } */ +/* { dg-require-effective-target vect_simd_clones } */ +/* { dg-options "-O2 -fopenmp-simd" } */ + +#pragma omp declare simd simdlen(4) notinbranch +__attribute__((noinline)) int +foo (double c1, double c2) +{ + double z1 = c1, z2 = c2; + int res = 100, i; + + for (i = 0; i < 5; i++) + { + res = (z1 * z1 + z2 * z2 > 4.0) ? (i < res ? i : res) : res; + z1 = c1 + z1 * z1 - z2 * z2; + z2 = c2 + 2.0 * z1 * z2; + c1 += 0.5; + c2 += 0.5; + } + return res; +} + +__attribute__((noinline, noclone)) void +bar (double *x, double *y) +{ + asm volatile ("" : : "rm" (x), "rm" (y) : "memory"); +} + +int +main () +{ + int i; + double c[4] = { 0.0, 1.0, 0.0, 1.0 }; + double d[4] = { 0.0, 1.0, 2.0, 0.0 }; + int e[4]; + bar (c, d); +#pragma omp simd safelen(4) + for (i = 0; i < 4; i++) + e[i] = foo (c[i], d[i]); + if (e[0] != 3 || e[1] != 1 || e[2] != 1 || e[3] != 2) + __builtin_abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-3.c b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-3.c new file mode 100644 index 000000000..93e9fbe3a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr60823-3.c @@ -0,0 +1,32 @@ +/* PR tree-optimization/60823 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp-simd -fno-strict-aliasing" } */ + +void bar (char *, double *); + +#if __SIZEOF_DOUBLE__ >= 4 + +struct S { char c[sizeof (double)]; }; +void baz (struct S, struct S); +union U { struct S s; double d; }; + +#pragma omp declare simd simdlen(4) notinbranch +__attribute__((noinline)) int +foo (double c1, double c2) +{ + double *a = &c1; + char *b = (char *) &c1 + 2; + + b[-2]++; + b[1]--; + *a++; + c2++; + bar ((char *) &c2 + 1, &c2); + c2 *= 3.0; + bar (b, a); + baz (((union U) { .d = c1 }).s, ((union U) { .d = c2 }).s); + baz (*(struct S *)&c1, *(struct S *)&c2); + return c1 + c2 + ((struct S *)&c1)->c[1]; +} + +#endif diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr61486-1.c b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr61486-1.c new file mode 100644 index 000000000..9ada58c8c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr61486-1.c @@ -0,0 +1,13 @@ +/* PR middle-end/61486 */ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +int +foo (int *a) +{ + int i, j = 0; + #pragma omp target teams distribute simd linear(i, j) map(a[:10]) + for (i = 0; i < 10; i++) + a[i] = j++; + return i + j; +} diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr61486-2.c b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr61486-2.c new file mode 100644 index 000000000..729438101 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/gomp/pr61486-2.c @@ -0,0 +1,458 @@ +/* PR middle-end/61486 */ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +#pragma omp declare target +void dosomething (int *a, int n, int m); +#pragma omp end declare target + +void +test (int n, int o, int p, int q, int r, int s, int *pp) +{ + int a[o], i, j; + #pragma omp target data device (n + 1) if (n != 6) map (tofrom: n, r) + { + #pragma omp target device (n + 1) if (n != 6) map (from: n) map (alloc: a[2:o-2]) + dosomething (a, n, 0); + #pragma omp target teams device (n + 1) num_teams (n + 4) thread_limit (n * 2) \ + if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp target teams distribute device (n + 1) num_teams (n + 4) collapse (2) \ + if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp target teams distribute device (n + 1) num_teams (n + 4) \ + if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp target teams distribute parallel for device (n + 1) num_teams (n + 4) \ + if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) collapse (2) \ + num_threads (n + 4) proc_bind (spread) lastprivate (s) \ + ordered schedule (static, 8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + #pragma omp ordered + p = q; + s = i * 10 + j; + } + #pragma omp target teams distribute parallel for device (n + 1) num_teams (n + 4) \ + if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) \ + proc_bind (master) lastprivate (s) ordered schedule (static, 8) + for (i = 0; i < 10; i++) + { + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp ordered + p = q; + s = i * 10; + } + #pragma omp target teams distribute parallel for simd device (n + 1) \ + if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) collapse (2) \ + num_threads (n + 4) proc_bind (spread) lastprivate (s) \ + schedule (static, 8) num_teams (n + 4) safelen(8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + a[2+i*10+j] = p + q; + s = i * 10 + j; + } + #pragma omp target teams distribute parallel for simd device (n + 1) \ + if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) \ + proc_bind (master) lastprivate (s) schedule (static, 8) \ + num_teams (n + 4) safelen(16) linear(i:1) aligned (pp:4) + for (i = 0; i < 10; i++) + { + r = r + 1; + p = q; + a[2+i] = p + q; + s = i * 10; + } + #pragma omp target teams distribute simd device (n + 1) \ + if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) collapse (2) \ + lastprivate (s) num_teams (n + 4) safelen(8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + a[2+i*10+j] = p + q; + s = i * 10 + j; + } + #pragma omp target teams distribute simd device (n + 1) \ + if (n != 6)map (from: n) map (alloc: a[2:o-2]) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) lastprivate (s) \ + num_teams (n + 4) safelen(16) linear(i:1) aligned (pp:4) + for (i = 0; i < 10; i++) + { + r = r + 1; + p = q; + a[2+i] = p + q; + s = i * 10; + } + #pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) + #pragma omp teams num_teams (n + 4) thread_limit (n * 2) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) + #pragma omp teams distribute num_teams (n + 4) collapse (2) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) + #pragma omp teams distribute num_teams (n + 4) default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) + #pragma omp teams distribute parallel for num_teams (n + 4) if (n != 6) \ + default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) collapse (2) \ + num_threads (n + 4) proc_bind (spread) lastprivate (s) \ + ordered schedule (static, 8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + #pragma omp ordered + p = q; + s = i * 10 + j; + } + #pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) + #pragma omp teams distribute parallel for num_teams (n + 4) if (n != 6) \ + default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) \ + proc_bind (master) lastprivate (s) ordered schedule (static, 8) + for (i = 0; i < 10; i++) + { + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp ordered + p = q; + s = i * 10; + } + #pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) + #pragma omp teams distribute parallel for simd if (n != 6)default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) collapse (2) \ + num_threads (n + 4) proc_bind (spread) lastprivate (s) \ + schedule (static, 8) num_teams (n + 4) safelen(8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + a[2+i*10+j] = p + q; + s = i * 10 + j; + } + #pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) + #pragma omp teams distribute parallel for simd if (n != 6)default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) \ + proc_bind (master) lastprivate (s) schedule (static, 8) \ + num_teams (n + 4) safelen(16) linear(i:1) aligned (pp:4) + for (i = 0; i < 10; i++) + { + r = r + 1; + p = q; + a[2+i] = p + q; + s = i * 10; + } + #pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) + #pragma omp teams distribute simd default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) collapse (2) \ + lastprivate (s) num_teams (n + 4) safelen(8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + a[2+i*10+j] = p + q; + s = i * 10 + j; + } + #pragma omp target device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) + #pragma omp teams distribute simd default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + thread_limit (n * 2) dist_schedule (static, 4) lastprivate (s) \ + num_teams (n + 4) safelen(16) linear(i:1) aligned (pp:4) + for (i = 0; i < 10; i++) + { + r = r + 1; + p = q; + a[2+i] = p + q; + s = i * 10; + } + #pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \ + num_teams (n + 4) thread_limit (n * 2)default(shared) shared(n) \ + private (p) reduction (+: r) + #pragma omp distribute collapse (2) dist_schedule (static, 4) firstprivate (q) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \ + num_teams (n + 4) thread_limit (n * 2) shared(n) private(p) reduction (+ : r) \ + default(shared) + #pragma omp distribute dist_schedule (static, 4) firstprivate (q) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \ + num_teams (n + 4) thread_limit (n * 2) + #pragma omp distribute parallel for if (n != 6) \ + default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \ + collapse (2) dist_schedule (static, 4) \ + num_threads (n + 4) proc_bind (spread) lastprivate (s) \ + ordered schedule (static, 8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + #pragma omp ordered + p = q; + s = i * 10 + j; + } + #pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \ + num_teams (n + 4) thread_limit (n * 2) + #pragma omp distribute parallel for if (n != 6) \ + default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \ + num_threads (n + 4) dist_schedule (static, 4) \ + proc_bind (master) lastprivate (s) ordered schedule (static, 8) + for (i = 0; i < 10; i++) + { + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp ordered + p = q; + s = i * 10; + } + #pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \ + num_teams (n + 4) thread_limit (n * 2) + #pragma omp distribute parallel for simd if (n != 6)default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + collapse (2) dist_schedule (static, 4) \ + num_threads (n + 4) proc_bind (spread) lastprivate (s) \ + schedule (static, 8) safelen(8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + a[2+i*10+j] = p + q; + s = i * 10 + j; + } + #pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \ + num_teams (n + 4) thread_limit (n * 2) + #pragma omp distribute parallel for simd if (n != 6)default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + num_threads (n + 4) dist_schedule (static, 4) \ + proc_bind (master) lastprivate (s) schedule (static, 8) \ + safelen(16) linear(i:1) aligned (pp:4) + for (i = 0; i < 10; i++) + { + r = r + 1; + p = q; + a[2+i] = p + q; + s = i * 10; + } + #pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \ + num_teams (n + 4) thread_limit (n * 2) default(shared) shared(n) private(p) \ + reduction(+:r) + #pragma omp distribute simd private (p) firstprivate (q) reduction (+: r) \ + collapse (2) dist_schedule (static, 4) lastprivate (s) safelen(8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + a[2+i*10+j] = p + q; + s = i * 10 + j; + } + #pragma omp target teams device (n + 1) if (n != 6)map(from:n) map(alloc:a[2:o-2]) \ + num_teams (n + 4) thread_limit (n * 2) default(shared) shared(n) private(p) \ + reduction(+:r) + #pragma omp distribute simd private (p) firstprivate (q) reduction (+: r) \ + lastprivate (s) dist_schedule (static, 4) safelen(16) linear(i:1) aligned (pp:4) + for (i = 0; i < 10; i++) + { + r = r + 1; + p = q; + a[2+i] = p + q; + s = i * 10; + } + } +} + +int q, i, j; + +void +test2 (int n, int o, int p, int r, int s, int *pp) +{ + int a[o]; + #pragma omp distribute collapse (2) dist_schedule (static, 4) firstprivate (q) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp distribute dist_schedule (static, 4) firstprivate (q) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp distribute parallel for if (n != 6) \ + default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \ + collapse (2) dist_schedule (static, 4) \ + num_threads (n + 4) proc_bind (spread) lastprivate (s) \ + ordered schedule (static, 8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + #pragma omp ordered + p = q; + s = i * 10 + j; + } + #pragma omp distribute parallel for if (n != 6) \ + default(shared) private (p) firstprivate (q) shared (n) reduction (+: r) \ + num_threads (n + 4) dist_schedule (static, 4) \ + proc_bind (master) lastprivate (s) ordered schedule (static, 8) + for (i = 0; i < 10; i++) + { + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + dosomething (a, n, p + q); + } + #pragma omp ordered + p = q; + s = i * 10; + } + #pragma omp distribute parallel for simd if (n != 6)default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + collapse (2) dist_schedule (static, 4) \ + num_threads (n + 4) proc_bind (spread) lastprivate (s) \ + schedule (static, 8) safelen(8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + a[2+i*10+j] = p + q; + s = i * 10 + j; + } + #pragma omp distribute parallel for simd if (n != 6)default(shared) \ + private (p) firstprivate (q) shared (n) reduction (+: r) \ + num_threads (n + 4) dist_schedule (static, 4) \ + proc_bind (master) lastprivate (s) schedule (static, 8) \ + safelen(16) linear(i:1) aligned (pp:4) + for (i = 0; i < 10; i++) + { + r = r + 1; + p = q; + a[2+i] = p + q; + s = i * 10; + } + #pragma omp distribute simd private (p) firstprivate (q) reduction (+: r) \ + collapse (2) dist_schedule (static, 4) lastprivate (s) safelen(8) + for (i = 0; i < 10; i++) + for (j = 0; j < 10; j++) + { + r = r + 1; + p = q; + a[2+i*10+j] = p + q; + s = i * 10 + j; + } + #pragma omp distribute simd private (p) firstprivate (q) reduction (+: r) \ + lastprivate (s) dist_schedule (static, 4) safelen(16) linear(i:1) aligned (pp:4) + for (i = 0; i < 10; i++) + { + r = r + 1; + p = q; + a[2+i] = p + q; + s = i * 10; + } +} diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/torture/pr60971.c b/gcc-4.9/gcc/testsuite/c-c++-common/torture/pr60971.c new file mode 100644 index 000000000..b7a967dab --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/torture/pr60971.c @@ -0,0 +1,34 @@ +/* PR tree-optimization/60971 */ +/* { dg-do run } */ + +#ifndef __cplusplus +#define bool _Bool +#endif + +volatile unsigned char c; + +__attribute__((noinline)) unsigned char +foo (void) +{ + return c; +} + +__attribute__((noinline)) bool +bar (void) +{ + return foo () & 1; +} + +int +main () +{ + c = 0x41; + c = bar (); + if (c != 1) + __builtin_abort (); + c = 0x20; + c = bar (); + if (c != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C new file mode 100644 index 000000000..7e4da11a2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C @@ -0,0 +1,17 @@ +// PR c++/60951 +// { dg-do compile { target c++11 } } + +struct Foo { + constexpr Foo(int x = 0) : memb(x) {} + int memb; +}; + +struct FooContainer { + Foo foo[2]; +}; + +void fubar() { + int nonConst = 0; + FooContainer fooContainer; + fooContainer = { { 0, nonConst } }; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem2.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem2.C new file mode 100644 index 000000000..86859aa12 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ptrmem2.C @@ -0,0 +1,13 @@ +// PR c++/61661 +// { dg-do compile { target c++11 } } + +struct Outer { + + void Bar(); + + struct Foo { + void (Outer::*ptr)() ; + }; + + static constexpr Foo foo = { &Outer::Bar }; +}; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template7.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template7.C new file mode 100644 index 000000000..e835dbf4d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-template7.C @@ -0,0 +1,32 @@ +// PR c++/61556 +// { dg-do compile { target c++11 } } + +class ValueType { +public: + constexpr operator int() const {return m_ID;}; + constexpr ValueType(const int v) + : m_ID(v) {} +private: + int m_ID; +}; + +class ValueTypeEnum { +public: + static constexpr ValueType doubleval = ValueType(1); +}; + +template +class ValueTypeInfo { +}; + +template +class FillFunctor { +public: + FillFunctor() { + ValueTypeInfo v; + } +}; + +int main() { + ValueTypeInfo v; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted49.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted49.C new file mode 100644 index 000000000..357be419d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/defaulted49.C @@ -0,0 +1,15 @@ +// PR c++/60980 +// { dg-do compile { target c++11 } } + +struct x0 +{ + x0 () = default; +}; +struct x1 +{ + x0 x2[2]; + void x3 () + { + x1 (); + } +}; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist84.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist84.C new file mode 100644 index 000000000..4d46746c5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist84.C @@ -0,0 +1,17 @@ +// PR c++/61242 +// { dg-do compile { target c++11 } } + +struct Foo +{ + struct A + { + const int &container; + const int &args; + }; + static void Create (const A &); +}; + +int main () +{ + Foo::Create ({{}, {}}); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist86.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist86.C new file mode 100644 index 000000000..ace2ef928 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist86.C @@ -0,0 +1,18 @@ +// PR c++/61382 +// { dg-do run { target c++11 } } + +struct A +{ + int i,j; + A(int i,int j):i(i),j(j){} +}; + +extern "C" int printf (const char *, ...); + +int main() +{ + int i = 0; + A a{i++,i++}; + if (a.i != 0 || a.j != 1) + __builtin_abort(); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const3.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const3.C new file mode 100644 index 000000000..a1ffaddc4 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const3.C @@ -0,0 +1,38 @@ +// PR c++/60992 +// { dg-do compile { target c++11 } } + +struct ScopeGuardGenerator { }; + +struct FF +{ + template < class F, class ... Ts > + void + operator () (F & ...) + { + const int n = sizeof ... (Ts) + 1; + void *mutexes[n]; + auto _on_scope_exit_var_0 = + ScopeGuardGenerator () + [&mutexes] { }; + } +}; + +template < class F > +int operator+ (ScopeGuardGenerator, F) { return 1; } + +struct D +{ + template < class T0, class T1, class T2, class ... T > + void + operator () (T0, T1, const T2 & t2, T & ... t) + { + base (t2, t ...); + } + FF base; +}; + +D run_with_locks; + +void Fn () +{ + run_with_locks ([] { }, 0, 0); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template13.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template13.C new file mode 100644 index 000000000..adbb4dbca --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-template13.C @@ -0,0 +1,20 @@ +// PR c++/61566 +// { dg-do compile { target c++11 } } + +struct function +{ + template < typename _Functor> + function (_Functor); +}; + +struct C +{ + template + void foo (T, function = [] {}); +}; + +void bar () +{ + C c; + c.foo (1); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this18.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this18.C new file mode 100644 index 000000000..fec2da615 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this18.C @@ -0,0 +1,30 @@ +// PR c++/61151 +// { dg-do compile { target c++11 } } + +struct B +{ + void foo () {} +}; + +template +struct A +{ + template void bar (); + B a; +}; + +template +template +void +A::bar () +{ + auto f = [this] () { auto g = [=] () { a.foo (); }; g (); }; + f (); +} + +int +main () +{ + A a; + a.bar (); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template10.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template10.C new file mode 100644 index 000000000..4a8c87e6d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template10.C @@ -0,0 +1,14 @@ +// PR c++/60999 +// { dg-do compile { target c++11 } } + +struct B +{ + template + struct A; + + template + struct A<1, M> + { + int X = M; + }; +}; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C new file mode 100644 index 000000000..60e53c419 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template11.C @@ -0,0 +1,15 @@ +// PR c++/58930 +// { dg-do compile { target c++11 } } + +struct SampleModule +{ + explicit SampleModule (int); +}; + +template < typename > +struct BaseHandler +{ + SampleModule module_ { 0 }; +}; + +BaseHandler a; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template12.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template12.C new file mode 100644 index 000000000..52ae25720 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template12.C @@ -0,0 +1,17 @@ +// PR c++/58753 +// { dg-do compile { target c++11 } } + +#include + +template +struct X {X(std::initializer_list) {}}; + +template +class T { + X x{1}; +}; + +int main() +{ + T t; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C new file mode 100644 index 000000000..65ccd0aaa --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template13.C @@ -0,0 +1,11 @@ +// PR c++/58704 +// { dg-do compile { target c++11 } } + +struct A {}; + +template struct B +{ + A a[1] = { }; +}; + +B b; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template9.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template9.C new file mode 100644 index 000000000..0cfbb9044 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/nsdmi-template9.C @@ -0,0 +1,16 @@ +// PR c++/60999 +// { dg-do compile { target c++11 } } + +template +struct foo +{ +}; + +template<> +struct foo +{ + static constexpr int code = 42; + unsigned int bar = static_cast(code); +}; + +foo a; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58155.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58155.C new file mode 100644 index 000000000..60b02ab65 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58155.C @@ -0,0 +1,13 @@ +// { dg-do compile { target c++11 } } + +#define BAZ "baz" + +#if 0 + +"bar"BAZ + +R"( + bar +)"BAZ + +#endif diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58781.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58781.C new file mode 100644 index 000000000..58c972f90 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr58781.C @@ -0,0 +1,18 @@ +// PR c++/58781 +// { dg-do compile { target c++11 } } + +#include + +int +operator""_s(const char32_t *a, size_t b) +{ + return 0; +} + +int +f() +{ + using a = decltype(U"\x1181"_s); + using b = decltype(U"\x8111"_s); + using c = decltype(U" \x1181"_s); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr60249.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr60249.C new file mode 100644 index 000000000..e650dcb45 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/pr60249.C @@ -0,0 +1,6 @@ +// PR c++/60249 +// { dg-do compile { target c++11 } } + +decltype(""_) x; // { dg-error "unable to find string literal operator" } + +// { dg-error "invalid type in declaration before" "invalid" { target *-*-* } 4 } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual15.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual15.C new file mode 100644 index 000000000..ca333c2e2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual15.C @@ -0,0 +1,13 @@ +// PR c++/59296 +// { dg-do compile { target c++11 } } + +struct Type +{ + void get() const& { } + void get() const&& { } +}; + +int main() +{ + Type{}.get(); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae50.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae50.C new file mode 100644 index 000000000..e8d90ca76 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae50.C @@ -0,0 +1,41 @@ +// PR c++/61083 +// { dg-do compile { target c++11 } } + +template T declval(); + +template +struct is_same { + static const bool value = false; +}; + +template +struct is_same { + static const bool value = true; +}; + +struct true_type {}; +struct false_type {}; + +template +struct is_foo { +private: + template struct helper {}; + + template static auto + test(Z z) -> decltype(helper(), true_type()); + + template static auto test(...) -> false_type; + +public: + enum { value = is_same(declval())), true_type>::value }; +}; + +struct A { + int foo(); + void foo() const; +}; + +struct A1 : public A {}; + +static_assert (is_foo::value == 1, ""); +static_assert (is_foo::value == 0, ""); diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic158.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic158.C new file mode 100644 index 000000000..cc5c24ddc --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic158.C @@ -0,0 +1,24 @@ +// PR c++/61134 +// { dg-do compile { target c++11 } } + +struct Base { }; + +template +struct Fixed { + typedef const char* name; +}; + +template +void New(const char* name, + typename Fixed::name... field_names); + +template +void CreateMetric(const char* name, + typename Fixed::name... field_names, + const Base&) { } + + +void Fn() +{ + CreateMetric("abcd", "def", Base()); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic159.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic159.C new file mode 100644 index 000000000..2b14d3005 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic159.C @@ -0,0 +1,14 @@ +// PR c++/61507 +// { dg-do compile { target c++11 } } + +struct A { + void foo(const int &); + void foo(float); +}; + +template +void bar(void (A::*memfun)(Args...), Args... args); + +void go(const int& i) { + bar(&A::foo, i); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic160.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic160.C new file mode 100644 index 000000000..20fcd5b4f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/variadic160.C @@ -0,0 +1,49 @@ +// PR c++/61539 +// { dg-do compile { target c++11 } } + +template class A; +template class B; +template class C; +template <> class C +{ + virtual void xparse (int &, const B > &) const; +}; +template class G : C +{ +public: + G (void *) {} + void default_value (const T &); + void xparse (int &, const B > &) const; +}; +template +void validate (int &, const B > &, T *, int); +template +void G::xparse (int &p1, const B > &p2) const +{ + validate (p1, p2, (T *)0, 0); +} +template G *value (T *) { return new G(0); } +namespace Eigen +{ +template struct D; +template class F; +template +struct D > +{ + typedef _Scalar Scalar; +}; +template class F +{ +public: + typedef typename Eigen::D::Scalar Scalar; + F (const Scalar &, const Scalar &, const Scalar &); +}; +template +void validate (int &, const B > &, Eigen::F *); +} +int main (int, char *[]) +{ + Eigen::F a (0, 0, 0); + value (&a)->default_value (Eigen::F(0, 0, 0)); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/pr59867.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/pr59867.C new file mode 100644 index 000000000..91d025964 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp1y/pr59867.C @@ -0,0 +1,52 @@ +// PR c++/59867 +// { dg-do compile { target c++1y } } + +#include +using namespace std; + +// constant +template + struct meta_value + { + typedef meta_value type; + typedef T value_type; + static const T value = x; + }; + +// array +template + struct meta_array + { + typedef meta_array type; + typedef T item_type; + }; + +// static array -> runtime array conversion utility +template + struct array_gen; + +template + struct array_gen> + { + static const T value[sizeof...(xs)]; + }; + +template + const T + array_gen>::value[sizeof...(xs)] = {xs...}; + +// static string +template + constexpr meta_array + operator""_s() + { + static_assert(sizeof...(xs) == 3, "What's wrong with you?"); + return meta_array(); + } + +int +main() +{ + auto a = "123"_s; + const char (& xs)[3] = array_gen::value; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C index e3bddab0e..bfa5d9292 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C +++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/cdtor-1.C @@ -14,4 +14,4 @@ main() K k; } -// { dg-final {scan-assembler-times " DW_AT_\[MIPS_\]*linkage_name" 2 } } +// { dg-final {scan-assembler-times " DW_AT_\[MIPS_\]*linkage_name" 4 } } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C new file mode 100644 index 000000000..160694c3c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-nested.C @@ -0,0 +1,55 @@ +// { dg-do compile } +// { dg-options "--std=c++11 -dA -gdwarf-4 -fdebug-types-section -fno-merge-debug-strings" } + +// Check that -fdebug-types-sections does not copy a full referenced type +// into a type unit. + +// Checks that at least one type unit is generated. +// +// { dg-final { scan-assembler "DIE \\(\[^\n\]*\\) DW_TAG_type_unit" } } +// +// Check that func is declared exactly once in the debug info (in the +// compile unit). +// +// { dg-final { scan-assembler-times "\\.ascii \"func\\\\0\"\[^\n\]*DW_AT_name" 1 } } +// +// Check to make sure that no type unit contains a DIE with DW_AT_low_pc +// or DW_AT_ranges. These patterns assume that the compile unit is always +// emitted after all type units. +// +// { dg-final { scan-assembler-not "\\.quad\[^\n\]*DW_AT_low_pc.*DIE \\(\[^\n\]*\\) DW_TAG_compile_unit" } } +// { dg-final { scan-assembler-not "\\.quad\[^\n\]*DW_AT_ranges.*DIE \\(\[^\n\]*\\) DW_TAG_compile_unit" } } + +struct A { + A(); + virtual ~A(); + virtual void foo(); + private: + int data; +}; + +struct B { + B(); + virtual ~B(); +}; + +extern B* table[]; + +struct D { + template + T* get(int i) + { + B*& cell = table[i]; + if (cell == 0) + cell = new T(); + return static_cast(cell); + } +}; + +void func(D* d) +{ + struct C : B { + A a; + }; + d->get(0)->a.foo(); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C index c5520fa72..89a6bb44e 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C +++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/dwarf4-typedef.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-gdwarf-4" } */ +/* { dg-options "-gdwarf-4 -fdebug-types-section" } */ /* Regression test for an ICE in output_die when using -gdwarf-4. */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C new file mode 100644 index 000000000..ce01f7238 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/imported-decl-2.C @@ -0,0 +1,32 @@ +// { dg-do compile } +// { dg-options "-gdwarf-2 -dA -O0 -fno-merge-debug-strings" } + +class AAAA +{ + public: + int method (void); + int a; +}; + +int +AAAA::method (void) +{ + return a; +} + +class BBBB : public AAAA +{ + public: + using AAAA::method; + + int method (int b); +}; + +int +BBBB::method (int b) +{ + return a + b; +} + +// { dg-final { scan-assembler-not "ascii \"BBBB\\\\0\".*ascii \"AAAA\\\\0\".*DW_TAG_imported_declaration" } } +// { dg-final { scan-assembler-times "ascii \"AAAA\\\\0\".*ascii \"BBBB\\\\0\".*DIE .0x\[0-9a-f\]*. DW_TAG_imported_declaration" 1 } } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C new file mode 100644 index 000000000..a63b8a9ef --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/debug/dwarf2/pr61433.C @@ -0,0 +1,23 @@ +// PR c++/61433 +// { dg-do compile { target c++11 } } +// { dg-options "-O -fcompare-debug -fno-inline -fno-ipa-pure-const -fipa-sra" } + +template +struct A +{ + template + struct B + { + int MEM; + }; +}; +struct D {}; +struct C: public A::B +{}; +template +auto k(T t, U u, V v) -> decltype (t.U::template B::MEM) +{} +int main() +{ + k( C(), A(), D() ); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/eh/spec3-static.C b/gcc-4.9/gcc/testsuite/g++.dg/eh/spec3-static.C deleted file mode 100644 index 15408effa..000000000 --- a/gcc-4.9/gcc/testsuite/g++.dg/eh/spec3-static.C +++ /dev/null @@ -1,25 +0,0 @@ -// PR c++/4381 -// Test that exception-specs work properly for classes with virtual bases. - -// { dg-do run } -// { dg-options "-static" } - -class Base {}; - -struct A : virtual public Base -{ - A() {} -}; - -struct B {}; - -void func() throw (B,A) -{ - throw A(); -} - -int main(void) -{ - try { func(); } - catch (A& a) { } -} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ext/complit14.C b/gcc-4.9/gcc/testsuite/g++.dg/ext/complit14.C new file mode 100644 index 000000000..aed765dc5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/ext/complit14.C @@ -0,0 +1,11 @@ +// PR c++/61614 +// { dg-options "" } + +int Fn (...); + +void +Test () +{ + int j = Fn ((const int[]) { 0 }); // OK + unsigned long sz = sizeof Fn ((const int[]) { 0 }); // Error +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/gcov/gcov-7.C b/gcc-4.9/gcc/testsuite/g++.dg/gcov/gcov-7.C deleted file mode 100644 index db3e95a07..000000000 --- a/gcc-4.9/gcc/testsuite/g++.dg/gcov/gcov-7.C +++ /dev/null @@ -1,28 +0,0 @@ -/* Check that Exception handler specification is not - mapped to the curly braces below the function - declaration. */ - -/* { dg-options "-fprofile-arcs -ftest-coverage" } */ -/* { dg-do run { target native } } */ - -struct foo -{ - foo () throw (int) - { /* count (-) */ - throw (1); - } -}; - -int main () -{ - try - { - foo f; - } - catch ( ...) - { - return 0; - } -} - -/* { dg-final { run-gcov gcov-7.C } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/guality/guality.exp b/gcc-4.9/gcc/testsuite/g++.dg/guality/guality.exp index 3ff7f2f77..215f6f80f 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/guality/guality.exp +++ b/gcc-4.9/gcc/testsuite/g++.dg/guality/guality.exp @@ -1,5 +1,8 @@ # This harness is for tests that should be run at all optimisation levels. +# Disable everywhere. These tests are very flaky. +return + load_lib g++-dg.exp load_lib gcc-gdb-test.exp diff --git a/gcc-4.9/gcc/testsuite/g++.dg/init/copy7.C b/gcc-4.9/gcc/testsuite/g++.dg/init/copy7.C new file mode 100644 index 000000000..655fae21e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/init/copy7.C @@ -0,0 +1,9 @@ +// CWG 5 + +struct C { }; +C c; +struct A { + A(const A&); + A(const C&); +}; +const volatile A a = c; // Okay diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-11.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-11.C index ca8ea4cc2..e31832b87 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-11.C +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-11.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-ipa-inline -fno-devirtualize-speculatively" } */ +/* { dg-options "-O2 -fdump-ipa-inline --param=early-inlining-insns-comdat=0 -fno-devirtualize-speculatively" } */ int baz (); struct A { @@ -45,5 +45,5 @@ bar () /* While inlining function called once we should devirtualize a new call to fn2 and two to fn3. While doing so the new symbol for fn2 needs to be introduced. */ -/* { dg-final { scan-ipa-dump-times "Discovered a virtual call to a known target" 1 "inline" } } */ +/* { dg-final { scan-ipa-dump "Discovered a virtual call to a known target" "inline" } } */ /* { dg-final { cleanup-ipa-dump "inline" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-25.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-25.C index 751647957..1da44f5d1 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-25.C +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-25.C @@ -22,5 +22,5 @@ void dpr_run(ebs_Object& objectA) { dpr_Job jobL; dpr_run(jobL); } -/* { dg-final { scan-ipa-dump "Type inconsident devirtualization" "cp" } } */ +/* { dg-final { scan-ipa-dump "Type inconsistent devirtualization" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-31.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-31.C new file mode 100644 index 000000000..64c44ba1e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-31.C @@ -0,0 +1,23 @@ +/* { dg-options "-O2 -std=c++11 -fdump-ipa-inline" } */ +#include + +class EmbeddedObject { +public: + virtual int val() { return 2; } +}; + +class Container { + alignas(EmbeddedObject) char buffer[sizeof(EmbeddedObject)]; +public: + EmbeddedObject *obj() { return (EmbeddedObject*)buffer; } + Container() { new (buffer) EmbeddedObject(); } +}; + +Container o; + +int main() +{ + __builtin_printf("%d\n", o.obj()->val()); +} +/* { dg-final { scan-ipa-dump-not "__builtin_unreachable" "inline" } } */ +/* { dg-final { cleanup-ipa-dump "inline" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-9.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-9.C index 7fd0bf5f5..dc6c6c940 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-9.C +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/devirt-9.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-ipa-whole-program" } */ +/* { dg-options "-O2 -fdump-ipa-whole-program --param=early-inlining-insns-comdat=0" } */ double foo (); struct B { diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60600.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60600.C index 00c368e63..b9039cb85 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60600.C +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr60600.C @@ -14,7 +14,7 @@ struct intermediate: top { }; struct child1: top { - void childf() + __attribute__((noinline)) void childf() { data d(topf()); } @@ -30,5 +30,5 @@ void test(top& t) test(d); } -/* { dg-final { scan-ipa-dump "Type inconsident devirtualization" "cp" } } */ +/* { dg-final { scan-ipa-dump "Type inconsistent devirtualization" "cp" } } */ /* { dg-final { cleanup-ipa-dump "cp" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61085.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61085.C new file mode 100644 index 000000000..531f59d53 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61085.C @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-early-inlining" } */ + +struct A {}; +struct B : virtual A { + unsigned m_i; + B() : m_i () {} + virtual A *m_virt () + { + return 0; + } + ~B () + { + m_foo (); + while (m_i) + ; + } + void m_foo () + { + m_virt (); + } +}; + +class C : B { + A *m_virt () { + __builtin_abort (); + } +}; + +int main () +{ + C c; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C new file mode 100644 index 000000000..a0fbb5f42 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-1.C @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +struct CBase { + virtual void BaseFunc () {} +}; + +struct MMixin { + virtual void * MixinFunc (int, void *) = 0; +}; + +struct CExample: CBase, public MMixin +{ + void *MixinFunc (int arg, void *arg2) + { + if (arg != 1 || arg2) + return 0; + return this; + } +}; + +void *test (MMixin & anExample) +{ + return anExample.MixinFunc (1, 0); +} + +int main () +{ + CExample c; + return (test (c) != &c); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C new file mode 100644 index 000000000..1011bd1ef --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-2.C @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-options "-O3 --param ipa-cp-eval-threshold=1" } */ + +extern "C" void abort (void); + +struct CBase { + virtual void BaseFunc () {} +}; + +struct MMixin { + virtual void * MixinFunc (int, void *) = 0; +}; + +struct CExample: CBase, public MMixin +{ + int stuff, magic, more_stuff; + + CExample () + { + stuff = 0; + magic = 0xbeef; + more_stuff = 0; + } + void *MixinFunc (int arg, void *arg2) + { + if (arg != 1 || arg2) + return 0; + if (magic != 0xbeef) + abort(); + return this; + } +}; + +void *test (MMixin & anExample) +{ + return anExample.MixinFunc (1, 0); +} + +int main () +{ + CExample c; + return (test (c) != &c); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-3.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-3.C new file mode 100644 index 000000000..8184ec2cd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61160-3.C @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O3" } */ + +struct A { + void *p; + A (void *q) : p (q) {} + A (const A &) : p () {} +}; + +struct CBase { + virtual void BaseFunc () {} +}; + +struct MMixin { + virtual A MixinFunc (int, A) = 0; +}; + +struct CExample: CBase, public MMixin +{ + A MixinFunc (int arg, A arg2) + { + if (arg != 1 || arg2.p) + return 0; + return this; + } +}; + +void *test (MMixin & anExample) +{ + return anExample.MixinFunc (1, (0)).p; +} + +int main () +{ + CExample c; + return (test (c) != &c); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61540.C b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61540.C new file mode 100644 index 000000000..e7dee7262 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/ipa/pr61540.C @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fno-early-inlining" } */ + +struct data { + data(int) {} +}; + +struct top { + virtual int topf() {} +}; + +struct intermediate: top { + int topf() /* override */ { return 0; } +}; + +struct child1: top { + void childf() + { + data d(topf()); + } +}; + +struct child2: intermediate {}; + +void test(top& t) +{ + child1& c = static_cast(t); + c.childf(); + child2 d; + test(d); +} + +int main (int argc, char **argv) +{ + child1 c; + test (c); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/opt/pr60849.C b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr60849.C new file mode 100644 index 000000000..52d8826b0 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr60849.C @@ -0,0 +1,13 @@ +// { dg-do compile } +// { dg-options "-O2" } + +int g; + +extern "C" int isnan (); + +void foo(float a) { + int (*xx)(...); + xx = isnan; + if (xx(a)) + g++; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/opt/pr60912.C b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr60912.C new file mode 100644 index 000000000..ad51ba725 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr60912.C @@ -0,0 +1,18 @@ +// { dg-do run } +// { dg-options "-O -fno-inline -fipa-pta" } + +struct IFoo +{ + virtual void Foo () = 0; +}; + +struct Bar:IFoo +{ + void Foo () {} +}; + +int main () +{ + (new Bar ())->Foo (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/opt/pr61456.C b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr61456.C new file mode 100644 index 000000000..14a118b57 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr61456.C @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-O2 -std=c++11 -Werror=uninitialized" } + +int rand (); + +class Funcs +{ +public: + int *f1 (); + int *f2 (); +}; +typedef decltype (&Funcs::f1) pfunc; + +static int Set (Funcs * f, const pfunc & fp) +{ + (f->*fp) (); +} + +void +Foo () +{ + pfunc fp = &Funcs::f1; + if (rand ()) + fp = &Funcs::f2; + Set (0, fp); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/opt/pr61654.C b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr61654.C new file mode 100644 index 000000000..78dc0c14c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/opt/pr61654.C @@ -0,0 +1,27 @@ +// PR middle-end/61654 +// { dg-do compile } + +class A +{ + virtual int a (int, int = 0) = 0; + int b (const int &); + int c; +}; + +class B : virtual A +{ + int d; + int a (int, int); +}; + +int +A::b (const int &) +{ + return a ('\0'); +} + +int +B::a (int, int) +{ + return 0 ? 0 : d; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/opt/typeinfo1.C b/gcc-4.9/gcc/testsuite/g++.dg/opt/typeinfo1.C new file mode 100644 index 000000000..efac4cbd1 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/opt/typeinfo1.C @@ -0,0 +1,27 @@ +// PR c++/61020 +// { dg-options "-O2" } +// { dg-do run } + +#include + +struct Base { + virtual ~Base() { } +}; + +struct Derived : public Base { +}; + +int compare(const Base& base) +{ + return typeid(base) == typeid(typeid(Derived)); +} + +int main() +{ + Base base; + Derived derived; + + if (compare(base)) return 1; + if (compare(derived)) return 2; + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-1.C b/gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-1.C new file mode 100644 index 000000000..2115627ef --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-1.C @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-fno-strict-enums" } */ + +extern "C" void abort (void); + +enum zero_one +{ zero = 0, one = 1 }; + +int * +allocate_bool (zero_one e) +{ + int *v = 0; + switch (e) + { + case zero: + v = new int (0); + case one: + v = new int (1); + } + return v; +} + +int +main () +{ + if (allocate_bool (static_cast < zero_one > (999))) + { + /* Error: should not have matched any case label. */ + abort (); + } + else + { + return 0; + } +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-2.C b/gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-2.C new file mode 100644 index 000000000..086989c51 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-2.C @@ -0,0 +1,37 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-strict-enums" } */ + +extern "C" void abort (void); + +enum X +{ + X1, + X2 +}; + +int +foo (enum X x) +{ + switch (x) + { + case X1: + return 0; + case X2: + return 1; + } + return x; +} + +int +main (int argc, char *argv[]) +{ + int n = argc + 999; + if (n == foo (static_cast < X > (n))) + { + return 0; + } + else + { + abort (); + } +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-3.C b/gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-3.C new file mode 100755 index 000000000..673601a41 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/other/no-strict-enum-precision-3.C @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-strict-enums" } */ + +extern "C" void abort (void); + +enum X +{ + X1, + X2 +}; + +int +main (int argc, char *argv[]) +{ + X x = static_cast < X > (argc + 999); + if (x == X1) + abort (); + if (x == X2) + abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/other/sized-delete-1.C b/gcc-4.9/gcc/testsuite/g++.dg/other/sized-delete-1.C new file mode 100644 index 000000000..76f861af3 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/other/sized-delete-1.C @@ -0,0 +1,14 @@ +// { dg-do link} +// { dg-options "-O -fsized-delete" } +// { dg-final { scan-assembler "_ZdlPv\[mj\]" } } +struct A +{ + int a[100]; +}; + +int main(void) +{ + A *a = new A; + delete a; + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/plugin/selfassign.c b/gcc-4.9/gcc/testsuite/g++.dg/plugin/selfassign.c index 041f25dce..9a0c620dd 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/plugin/selfassign.c +++ b/gcc-4.9/gcc/testsuite/g++.dg/plugin/selfassign.c @@ -211,7 +211,7 @@ compare_and_warn (gimple stmt, tree lhs, tree rhs) /* Check and warn if STMT is a self-assign statement. */ static void -warn_self_assign (gimple stmt) +check_self_assign (gimple stmt) { tree rhs, lhs; @@ -264,7 +264,7 @@ execute_warn_self_assign (void) FOR_EACH_BB_FN (bb, cfun) { for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - warn_self_assign (gsi_stmt (gsi)); + check_self_assign (gsi_stmt (gsi)); } return 0; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/pr60969.C b/gcc-4.9/gcc/testsuite/g++.dg/pr60969.C new file mode 100644 index 000000000..4012e2ce7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/pr60969.C @@ -0,0 +1,32 @@ +/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ +/* { dg-options "-O2 -ftree-vectorize -march=pentium4 -mfpmath=387" } */ + +struct A +{ + float f, g, h, k; + A () {} + A (float v0, float x, float y) : f(v0), g(x), h(y), k(0.0f) {} + A bar (A &a, float t) { return A (f + a.f * t, g + a.g * t, h + a.h * t); } +}; + +A +baz (A &x, A &y, float t) +{ + return x.bar (y, t); +} + +A * +foo (A &s, A &t, A &u, A &v, int y, int z) +{ + A *x = new A[y * z]; + for (int i = 0; i < 7; i++) + { + A s = baz (s, u, i / (float) z); + A t = baz (t, v, i / (float) z); + for (int j = 0; j < 7; j++) + x[i * y + j] = baz (s, t, j / (float) y); + } + return x; +} + +/* { dg-final { scan-assembler-not "%mm" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/pr61094.C b/gcc-4.9/gcc/testsuite/g++.dg/pr61094.C new file mode 100644 index 000000000..35adc256c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/pr61094.C @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ + +template struct A { + unsigned _width, _height, _depth, _spectrum; + template A(t p1) { + int a = p1.size(); + if (a) { + _width = p1._width; + _depth = _height = _spectrum = p1._spectrum; + } + } + long size() { return (long)_width * _height * _depth * _spectrum; } +}; + +int d; +void fn1(void *); +A *fn2(); +void fn3() { + int b; + for (;;) { + A c(*fn2()); + fn1(&c); + if (d || !b) + throw; + } +} + + + + diff --git a/gcc-4.9/gcc/testsuite/g++.dg/pr61289-2.c b/gcc-4.9/gcc/testsuite/g++.dg/pr61289-2.c new file mode 100644 index 000000000..4cc3ebe46 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/pr61289-2.c @@ -0,0 +1,62 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-exceptions" } */ +struct S +{ + inline int fn1 () const { return s; } + __attribute__ ((noinline, noclone)) S *fn2 (int); + __attribute__ ((noinline, noclone)) void fn3 (); + __attribute__ ((noinline, noclone)) static S *fn4 (int); + S (int i) : s (i) {} + int s; +}; + +int a = 0; +S *b = 0; + +S * +S::fn2 (int i) +{ + a++; + if (a == 1) + return b; + if (a > 3) + __builtin_abort (); + b = this; + return new S (i + s); +} + +S * +S::fn4 (int i) +{ + b = new S (i); + return b; +} + +void +S::fn3 () +{ + delete this; +} + +void +foo () +{ + S *c = S::fn4 (20); + for (int i = 0; i < 2;) + { + S *d = c->fn2 (c->fn1 () + 10); + if (c != d) +{ + c->fn3 (); + c = d; + ++i; +} + } + c->fn3 (); +} + +int +main () +{ + foo (); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/pr61289.C b/gcc-4.9/gcc/testsuite/g++.dg/pr61289.C new file mode 100644 index 000000000..ea7ccea30 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/pr61289.C @@ -0,0 +1,63 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-exceptions" } */ + +struct S +{ + inline int fn1 () const { return s; } + __attribute__ ((noinline, noclone)) S *fn2 (int); + __attribute__ ((noinline, noclone)) void fn3 (); + __attribute__ ((noinline, noclone)) static S *fn4 (int); + S (int i) : s (i) {} + int s; +}; + +int a = 0; +S *b = 0; + +S * +S::fn2 (int i) +{ + a++; + if (a == 1) + return b; + if (a > 3) + __builtin_abort (); + b = this; + return new S (i + s); +} + +S * +S::fn4 (int i) +{ + b = new S (i); + return b; +} + +void +S::fn3 () +{ + delete this; +} + +void +foo () +{ + S *c = S::fn4 (20); + for (int i = 0; i < 2;) + { + S *d = c->fn2 (c->fn1 () + 10); + if (d != c) +{ + c->fn3 (); + c = d; + ++i; +} + } + c->fn3 (); +} + +int +main () +{ + foo (); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/rtti/repo1.C b/gcc-4.9/gcc/testsuite/g++.dg/rtti/repo1.C index f72a9730a..16dd3028e 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/rtti/repo1.C +++ b/gcc-4.9/gcc/testsuite/g++.dg/rtti/repo1.C @@ -2,6 +2,7 @@ // { dg-options "-frepo" } // { dg-require-host-local "" } // { dg-skip-if "dkms are not final links" { vxworks_kernel } } +// { dg-skip-if "-frepo not supported with --sysroot (as it is not passed to COLLECT_GCC_OPTIONS" { *-*-linux* } { "*" } { "" } } #include template diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/conv14.C b/gcc-4.9/gcc/testsuite/g++.dg/template/conv14.C new file mode 100644 index 000000000..509ae6a65 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/conv14.C @@ -0,0 +1,30 @@ +// PR c++/61647 + +class XX; + +template +struct Accessor; + +template +class Variant { +protected: + KeyStore index; + Container state; +public: + Variant(Container st, const Key& i) : index(i), state(st) {} + + template + operator T() const { + return Accessor::template get(state, index); + } +}; + +class AutoCleanVariant : public Variant { +public: + AutoCleanVariant(XX* st, int i) : Variant(st,i) {} + + template + operator T() const { + return Variant::operator T(); + } +}; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/local-fn1.C b/gcc-4.9/gcc/testsuite/g++.dg/template/local-fn1.C new file mode 100644 index 000000000..88acd17d7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/local-fn1.C @@ -0,0 +1,8 @@ +// PR c++/60605 + +template +struct Foo { + void bar() { + void bug(); + } +}; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/pr61537.C b/gcc-4.9/gcc/testsuite/g++.dg/template/pr61537.C new file mode 100644 index 000000000..12aaf58ef --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/pr61537.C @@ -0,0 +1,23 @@ +// PR c++/61537 +// { dg-do compile } + +struct A {}; + +template +struct B +{ + template + void f(U, struct A); +}; + +template +template +void B::f(U, struct A) +{ +} + +int main() +{ + B b; + b.f(42, A()); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem27.C b/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem27.C new file mode 100644 index 000000000..8c63f9c29 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem27.C @@ -0,0 +1,22 @@ +// PR c++/61500 + +struct X { + int i; + int j; + + int foo(int X::* ptr); + + template + int bar(); +}; + +int X::foo(int X::* ptr) { + int* p = &(this->*ptr); // OK. + return *p; +} + +template +int X::bar() { + int* p = &(this->*ptr); // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode. + return *p; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem28.C b/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem28.C new file mode 100644 index 000000000..037996087 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/template/ptrmem28.C @@ -0,0 +1,10 @@ +// PR c++/61488 + +struct A { + typedef int (A::*cont_func)(); + template void wait(int); + int notify(); + + void fix() { wait<&A::notify>(0); } // OK + template void repair() { wait<&A::notify>(0); } +}; diff --git a/gcc-4.9/gcc/testsuite/g++.dg/thunk_section_name.C b/gcc-4.9/gcc/testsuite/g++.dg/thunk_section_name.C new file mode 100644 index 000000000..12c25c991 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/thunk_section_name.C @@ -0,0 +1,30 @@ +/* { dg-require-named-sections "" } */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-reorder-blocks-and-partition -ffunction-sections" } */ + +class base_class_1 +{ +public: + virtual void vfn () {} +}; + +class base_class_2 +{ +public: + virtual void vfn () {} +}; + +class need_thunk_class : public base_class_1, public base_class_2 +{ +public: + virtual void vfn () {} +}; + +int main (int argc, char *argv[]) +{ + base_class_1 *c = new need_thunk_class (); + c->vfn(); + return 0; +} + +/* { dg-final { scan-assembler "\.text\._ZThn\[4|8\]_N16need_thunk_class3vfnEv" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tls/thread_local9.C b/gcc-4.9/gcc/testsuite/g++.dg/tls/thread_local9.C new file mode 100644 index 000000000..c75528a02 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tls/thread_local9.C @@ -0,0 +1,23 @@ +// PR c++/61343 + +// { dg-do run { target c++11 } } +// { dg-add-options tls } +// { dg-require-effective-target tls_runtime } + +struct Foo { + int value; + + Foo() noexcept { + value = 12; + } +}; + +static thread_local Foo a{}; + +static __attribute__((noinline)) void UseA() { + if (a.value != 12) __builtin_abort(); +} + +int main() { + UseA(); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/torture/pr60854.C b/gcc-4.9/gcc/testsuite/g++.dg/torture/pr60854.C new file mode 100644 index 000000000..fa4b2e71a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/torture/pr60854.C @@ -0,0 +1,13 @@ +template +class MyClass +{ +public: + __attribute__ ((__always_inline__)) inline MyClass () { ; } +}; + +extern template class MyClass; + +void Func() +{ + MyClass x; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/torture/pr60895.C b/gcc-4.9/gcc/testsuite/g++.dg/torture/pr60895.C new file mode 100644 index 000000000..0edd36ada --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/torture/pr60895.C @@ -0,0 +1,32 @@ +// { dg-do compile } + +struct C +{ + double elems[3]; +}; + +C +foo () +{ + C a; + double *f = a.elems; + int b; + for (; b;) + { + *f = 0; + ++f; + } + return a; +} + +struct J +{ + C c; + __attribute__((always_inline)) J () : c (foo ()) {} +}; + +void +bar () +{ + J (); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_1.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_1.C new file mode 100644 index 000000000..c58f3ca94 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_1.C @@ -0,0 +1,45 @@ +/* Verify if call-graph profile sections are created with -freorder-functions=. + Check of edge profiles and node profiles are present in the profile + sections. Check if the segment splitting API is invoked. */ +/* { dg-require-section-exclude "" } */ +/* { dg-require-linker-function-reordering-plugin "" } */ +/* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections --save-temps -Wl,-plugin-opt,file=linker.dump -Wl,-plugin-opt,split_segment=yes" } */ + +int +notcalled () +{ + return 0; +} + +int __attribute__ ((noinline)) +foo () +{ + return 1; +} + +int __attribute__ ((noinline)) +bar () +{ + return 0; +} + +int main () +{ + int sum; + for (int i = 0; i< 1000; i++) + { + sum = foo () + bar(); + } + return sum * bar (); +} + +/* { dg-final-use { scan-assembler "\.gnu\.callgraph\.text\.main" } } */ +/* { dg-final-use { scan-assembler "\.string \"1000\"" } } */ +/* { dg-final-use { scan-assembler "\.string \"Weight 1000 1000\"" } } */ +/* { dg-final-use { scan-assembler "\.string \"Weight 1001 1001\"" } } */ +/* Check if main is next to foo or bar */ +/* { dg-final-use { scan-file linker.dump "Callgraph group : *\(_Z3foov main|main _Z3foov|_Z3barv main|main _Z3barv\).*\n" } } */ +/* { dg-final-use { scan-file linker.dump ".text\..*\._Z9notcalledv entry count = 0 computed = 0 max count = 0" } } */ +/* { dg-final-use { scan-file linker.dump "Moving .* section\\(s\\) to new segment" } } */ +/* { dg-final-use { cleanup-saved-temps } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_2.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_2.C new file mode 100644 index 000000000..5e238d8e2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_2.C @@ -0,0 +1,25 @@ +/* Check if the edge_cutoffa option to the function reordering plugin works as + expected. */ +/* { dg-require-section-exclude "" } */ +/* { dg-require-linker-function-reordering-plugin "" } */ +/* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -Wl,-plugin-opt,file=linker.dump -Wl,-plugin-opt,edge_cutoff=a1000" } */ + +int __attribute__ ((noinline)) +foo () +{ + return 1; +} + +int main () +{ + int sum = 0; + for (int i = 0; i< 1000; i++) + { + sum += foo (); + } + return sum - 1000; +} + +/* { dg-final-use { scan-file linker.dump "Not considering edge with weight 1000 and below" } } */ +/* { dg-final-use { scan-file-not linker.dump "Callgraph group" } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C new file mode 100644 index 000000000..f316701c8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_3.C @@ -0,0 +1,25 @@ +/* Check if the edge_cutoffp option to the function reordering plugin works as + expected. */ +/* { dg-require-section-exclude "" } */ +/* { dg-require-linker-function-reordering-plugin "" } */ +/* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -Wl,-plugin-opt,file=linker.dump -Wl,-plugin-opt,edge_cutoff=p100" } */ + +int __attribute__ ((noinline)) +foo () +{ + return 1; +} + +int main () +{ + int sum = 0; + for (int i = 0; i< 1000; i++) + { + sum += foo (); + } + return sum - 1000; +} + +/* { dg-final-use { scan-file linker.dump "Not considering edge with weight 1000 and below" } } */ +/* { dg-final-use { scan-file-not linker.dump "Callgraph group" } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_4.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_4.C new file mode 100644 index 000000000..58e38ad35 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_4.C @@ -0,0 +1,41 @@ +/* Check if cutting off callgraph gets all functions laid out only according to + function profiles and not prefixes. foo_200 is as hot as the other foo's but + has a unlikely section prefix. This should not matter as sort_name_prefix + is turned off. */ +/* { dg-require-section-exclude "" } */ +/* { dg-require-linker-function-reordering-plugin "" } */ +/* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -Wl,-plugin-opt,file=linker.dump,-plugin-opt,edge_cutoff=p100,-plugin-opt,sort_name_prefix=no" } */ + +int __attribute__ ((noinline, section(".text.unlikely._Z7foo_200v"))) +foo_200 () +{ + return 1; +} + +int __attribute__ ((noinline)) +foo_100 () +{ + return 1; +} + +int __attribute__ ((noinline)) +foo_300 () +{ + return 1; +} +int main () +{ + int sum = 0; + for (int i = 0; i< 200; i++) + sum += foo_200 (); + for (int i = 0; i< 100; i++) + sum += foo_100 (); + for (int i = 0; i< 300; i++) + sum += foo_300 (); + return sum - 600; +} + +/* { dg-final-use { scan-file-not linker.dump "Callgraph group" } } */ +/* { dg-final-use { scan-file linker.dump ".text.unlikely._Z7foo_200v entry count = 200 computed = 200 max count = 200" } } */ +/* { dg-final-use { scan-file linker.dump "\.text\.*\._Z7foo_100v.*\n\.text\.unlikely\._Z7foo_200v.*\n\.text\.*\._Z7foo_300v.*\n" } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_5.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_5.C new file mode 100644 index 000000000..dbae8d774 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_5.C @@ -0,0 +1,41 @@ +/* Check if cutting off callgraph and using sort_name_prefix gets all functions laid out + according to prefixes. foo_200 is almost as hot as the other foo's but should + not be grouped with them as it has a different section prefix and sort_name_prefix is + turned on. */ +/* { dg-require-section-exclude "" } */ +/* { dg-require-linker-function-reordering-plugin "" } */ +/* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -Wl,-plugin-opt,file=linker.dump,-plugin-opt,edge_cutoff=p100,-plugin-opt,sort_name_prefix=yes" } */ + +int __attribute__ ((noinline, section(".text.unlikely._Z7foo_200v"))) +foo_200 () +{ + return 1; +} + +int __attribute__ ((noinline)) +foo_100 () +{ + return 1; +} + +int __attribute__ ((noinline)) +foo_300 () +{ + return 1; +} +int main () +{ + int sum = 0; + for (int i = 0; i< 200; i++) + sum += foo_200 (); + for (int i = 0; i< 100; i++) + sum += foo_100 (); + for (int i = 0; i< 300; i++) + sum += foo_300 (); + return sum - 600; +} + +/* { dg-final-use { scan-file-not linker.dump "Callgraph group" } } */ +/* { dg-final-use { scan-file linker.dump ".text.unlikely._Z7foo_200v entry count = 200 computed = 200 max count = 200" } } */ +/* { dg-final-use { scan-file linker.dump "\.text\.unlikely\._Z7foo_200v.*\n\.text\.*\._Z7foo_100v.*\n\.text\.*\._Z7foo_300v.*\n" } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_6.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_6.C new file mode 100644 index 000000000..1116a4f44 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_6.C @@ -0,0 +1,53 @@ +/* Check if use_maxcount works as expected. This makes the node profile weight to + be equal to the maximum count of any basic block in a function rather than the + entry count. foo_100's maxcount > foo_200's max count */ +/* { dg-require-section-exclude "" } */ +/* { dg-require-linker-function-reordering-plugin "" } */ +/* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -Wl,-plugin-opt,file=linker.dump -Wl,-plugin-opt,edge_cutoff=p100,-plugin-opt,use_maxcount=yes" } */ + + +int __attribute__ ((noinline)) +bar (int *i) +{ + (*i)--; + if (*i >= 0) + return 1; + return 0; +} + +int __attribute__ ((noinline)) +foo_100 (int count) +{ + int sum = 0; + while (count > 0) + { + sum += bar(&count); + } + return sum; +} + +int __attribute__ ((noinline)) +foo_200 (int count) +{ + int sum = 0; + while (count > 0) + { + sum += bar(&count); + } + return sum; +} + +int main () +{ + int sum = 0; + for (int i = 0; i< 200; i++) + sum += foo_200 (100); + for (int i = 0; i< 100; i++) + sum += foo_100 (400); + return sum - 60000; +} +/* { dg-final-use { scan-file-not linker.dump "Callgraph group" } } */ +/* { dg-final-use { scan-file linker.dump "\.text\.*\._Z7foo_100i entry count = 100 computed = 100 max count = 40000" } } */ +/* { dg-final-use { scan-file linker.dump "\.text\.*\._Z7foo_200i entry count = 200 computed = 200 max count = 20000" } } */ +/* { dg-final-use { scan-file linker.dump "\.text\.*\._Z7foo_200i.*\n\.text\.*\._Z7foo_100i.*\n\.text\.*\._Z3barPi.*\n" } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_7.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_7.C new file mode 100644 index 000000000..3af8636ad --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_7.C @@ -0,0 +1,55 @@ +/* Check if turning off use_maxcount works as expected. This makes the node + profile weight to be equal to the entry count of any basic block in a + function rather than the max count. + foo_100's maxcount > foo_200's max count but + foo_100's entry count < foo_200's entry count. */ +/* { dg-require-section-exclude "" } */ +/* { dg-require-linker-function-reordering-plugin "" } */ +/* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -Wl,-plugin-opt,file=linker.dump -Wl,-plugin-opt,edge_cutoff=p100,-plugin-opt,use_maxcount=no" } */ + + +int __attribute__ ((noinline)) +bar (int *i) +{ + (*i)--; + if (*i >= 0) + return 1; + return 0; +} + +int __attribute__ ((noinline)) +foo_100 (int count) +{ + int sum = 0; + while (count > 0) + { + sum += bar(&count); + } + return sum; +} + +int __attribute__ ((noinline)) +foo_200 (int count) +{ + int sum = 0; + while (count > 0) + { + sum += bar(&count); + } + return sum; +} + +int main () +{ + int sum = 0; + for (int i = 0; i< 200; i++) + sum += foo_200 (100); + for (int i = 0; i< 100; i++) + sum += foo_100 (400); + return sum - 60000; +} +/* { dg-final-use { scan-file-not linker.dump "Callgraph group" } } */ +/* { dg-final-use { scan-file linker.dump "\.text\.*\._Z7foo_100i entry count = 100 computed = 100 max count = 40000" } } */ +/* { dg-final-use { scan-file linker.dump "\.text\.*\._Z7foo_200i entry count = 200 computed = 200 max count = 20000" } } */ +/* { dg-final-use { scan-file linker.dump "\.text\.*\._Z7foo_100i.*\n\.text\.*\._Z7foo_200i.*\n\.text\.*\._Z3barPi.*\n" } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C new file mode 100644 index 000000000..3f1a0156e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_8.C @@ -0,0 +1,19 @@ +/* Check if unlikely_cutoff works as expected. Function foo is unlikely because of the cutoff. */ +/* { dg-require-section-exclude "" } */ +/* { dg-require-linker-function-reordering-plugin "" } */ +/* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -Wl,-plugin-opt,file=linker.dump -Wl,-plugin-opt,edge_cutoff=p100,-plugin-opt,unlikely_cutoff=1" } */ + +int __attribute__ ((noinline,section(".text.hot._Z3foov"))) +foo () +{ + return 0; +} + +int main() +{ + return foo (); +} + +/* { dg-final-use { scan-file-not linker.dump "Callgraph group" } } */ +/* { dg-final-use { scan-file linker.dump "=== Unlikely sections start ===\n.*\.text\.hot\._Z3foov.* entry count = 1 computed = 1 max count = 1 split = 0\n.*=== Unlikely sections end ===" } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_split_functions_1.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_split_functions_1.C new file mode 100644 index 000000000..2f184c3e8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/func_reorder_gold_plugin_split_functions_1.C @@ -0,0 +1,63 @@ +/* Check if the gold function reordering plugin reorders split functions. + Check if foo is split and the cold section of foo is not next to its hot + section*/ +/* { dg-require-section-exclude "" } */ +/* { dg-require-linker-function-reordering-plugin "" } */ +/* { dg-require-effective-target freorder } */ +/* { dg-options "-O2 -freorder-functions=callgraph -ffunction-sections -freorder-blocks-and-partition --save-temps -Wl,-plugin-opt,file=linker.dump" } */ + + +#define SIZE 10000 + +const char *sarr[SIZE]; +const char *buf_hot; +const char *buf_cold; + +__attribute__ ((noinline)) +int bar (int *arg) +{ + (*arg)++; + return 0; +} + +__attribute__((noinline)) +void +foo (int path) +{ + int i; + bar (&path); + if (path) + { + for (i = 0; i < SIZE; i++) + sarr[i] = buf_hot; + } + else + { + for (i = 0; i < SIZE; i++) + sarr[i] = buf_cold; + } +} + +int +main (int argc, char *argv[]) +{ + buf_hot = "hello"; + buf_cold = "world"; + foo (argc); + return 0; +} + +/* { dg-final-use { scan-assembler "\.string \"ColdWeight 0\"" } } */ +/* { dg-final-use { scan-assembler "\.section.*\.text\.hot\._Z3fooi" } } */ +/* { dg-final-use { scan-assembler "\.section.*\.text\.unlikely\._Z3fooi" } } */ +/* { dg-final-use { cleanup-saved-temps } } */ +/* Check if foo and bar are together */ +/* { dg-final-use { scan-file linker.dump "Callgraph group :.*\(_Z3fooi _Z3barPi|_Z3barPi _Z3fooi\).*\n" } } */ +/* Check if foo and main are together */ +/* { dg-final-use { scan-file linker.dump "Callgraph group :.*\(_Z3fooi main|main _Z3fooi\).*\n" } } */ +/* { dg-final-use { scan-file linker.dump "\.text\.unlikely\._Z3fooi .* split = 1" } } */ +/* Check if unlikely sections of foo and bar are together */ +/* { dg-final-use { scan-file linker.dump "\(\.text\.unlikely\._Z3fooi\[^\n\]*\n\.text\.unlikely\._Z3barPi\[^\n\]*\n|\.text\.unlikely\._Z3barPi\[^\n\]*\n\.text\.unlikely\._Z3fooi\[^\n\]*\n\)" } } */ +/* Check if likely sections of hot foo and bar are together */ +/* { dg-final-use { scan-file linker.dump "\(\.text\._Z3barPi\[^\n\]*\n\.text\.hot\._Z3fooi|\.text\.hot\._Z3fooi\[^\n\]*\n\.text\._Z3barPi\)" } } */ +/* { dg-final-use { remove-build-file "linker.dump" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/indir-call-prof-2_0.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/indir-call-prof-2_0.C new file mode 100644 index 000000000..e20cc64d3 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/indir-call-prof-2_0.C @@ -0,0 +1,35 @@ +/* { dg-options "-O" } */ + +int foo1(void) { return 0; } +int bar1(void) { throw 1; } +void foo2(void) { } +void bar2(void) { throw 1; } +void __attribute__((noinline,noclone)) test1(void (*f)(void)) { (*f)(); } +void __attribute__((noinline,noclone)) test2(void (*f)(void)) { (*f)(); } +int __attribute__((noinline,noclone)) test3(int (*f)(void)) { return (*f)(); } +int __attribute__((noinline,noclone)) test4(int (*f)(void)) { return (*f)(); } +int __attribute__((noinline,noclone)) test5(int (*f)(void), int x) { return x ? x : (*f)(); } +int __attribute__((noinline,noclone)) test6(int (*f)(void), int x) { return x ? x : (*f)(); } +void __attribute__((noinline,noclone)) test7(void (*f)(void)) { try { (*f)(); } catch (...) {} } +void __attribute__((noinline,noclone)) test8(void (*f)(void)) { try { (*f)(); } catch (...) {}} +int __attribute__((noinline,noclone)) test9(int (*f)(void)) { try { return (*f)(); } catch (...) {return 0;} } +int __attribute__((noinline,noclone)) test10(int (*f)(void)) { try { return (*f)(); } catch (...) {return 0;} } +int __attribute__((noinline,noclone)) test11(int (*f)(void), int x) { try { return x ? x : (*f)(); } catch (...) {return 0;} } +int __attribute__((noinline,noclone)) test12(int (*f)(void), int x) { try { return x ? x : (*f)(); } catch (...) {return 0;} } + +int main() +{ + for (int i = 0; i < 100; ++i) test1(foo2); + for (int i = 0; i < 100; ++i) try { test2(bar2); } catch (...) {} + for (int i = 0; i < 100; ++i) test3(foo1); + for (int i = 0; i < 100; ++i) try { test4(bar1); } catch (...) {} + for (int i = 0; i < 100; ++i) test5(foo1, 0); + for (int i = 0; i < 100; ++i) try { test6(bar1, 0); } catch (...) {} + for (int i = 0; i < 100; ++i) test7(foo2); + for (int i = 0; i < 100; ++i) try { test8(bar2); } catch (...) {} + for (int i = 0; i < 100; ++i) test9(foo1); + for (int i = 0; i < 100; ++i) try { test10(bar1); } catch (...) {} + for (int i = 0; i < 100; ++i) test11(foo1, 0); + for (int i = 0; i < 100; ++i) try { test12(bar1, 0); } catch (...) {} + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/indir-call-prof_0.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/indir-call-prof_0.C new file mode 100644 index 000000000..b34b937fd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/indir-call-prof_0.C @@ -0,0 +1,39 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ + +struct A { + A () {} + + virtual int AA (void) + { return 0; } + +}; + +struct B : public A { + B () {} + + virtual int AA (void) + { return 1; } +}; + +void * __attribute__((noinline,noclone)) wrap (void *p) { return p; } +int +main (void) +{ + A a; + B b; + + A* p; + + p = (A *)wrap ((void *)&a); + p->AA (); + + p = (B *)wrap ((void *)&b); + p->AA (); + + return 0; +} + +/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* AA " "profile" } } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized" } } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C new file mode 100644 index 000000000..e82a46ebf --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/inline_mismatch_args_0.C @@ -0,0 +1,36 @@ +/* { dg-options "-O2 -fdump-tree-einline" } */ +class DocId { + public: + DocId() { } + DocId(const DocId &other) { } +}; + +int g; +class Base { + public: + virtual void Foo(DocId id) { g++; } +}; + +class Super: public Base { + public: + void Foo(DocId id) { } + void Bar(Base *base, DocId id) __attribute__((noinline)); +}; + +void Super::Bar(Base *base, DocId id) { + Super::Foo(id); // direct call is inlined + base->Foo(id); // indirect call is marked do not inline +} + +int main(void) +{ + Base bah; + Super baz; + DocId gid; + + baz.Bar(&baz, gid); + return 0; +} +/* { dg-final-use { scan-tree-dump "Inlining .*Super::Foo" "einline" } } */ +/* { dg-final-use { scan-tree-dump-not "mismatched arguments" "einline" } } */ +/* { dg-final-use { cleanup-tree-dump "einline" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/lipo.exp b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/lipo.exp new file mode 100644 index 000000000..2d1ddd7cd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/lipo.exp @@ -0,0 +1,60 @@ +# Copyright (C) 2001, 2002, 2004, 2005, 2007, 2008 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Test the functionality of programs compiled with profile-directed block +# ordering using -fprofile-generate followed by -fprofile-use. + +load_lib target-supports.exp + +# Some targets don't support tree profiling. +if { ![check_profiling_available ""] } { + return +} + +# The procedures in profopt.exp need these parameters. +set tool g++ +set prof_ext [list {gcda} {gcda.imports} ] + +# Override the list defined in profopt.exp. +set PROFOPT_OPTIONS [list {}] + +if $tracelevel then { + strace $tracelevel +} + +# Load support procs. +load_lib profopt.exp + +# These are globals used by profopt-execute. The first is options +# needed to generate profile data, the second is options to use the +# profile data. +set profile_option "-fprofile-generate -fripa" +set feedback_option "-fprofile-use -fripa" + +# Add -fno-section-anchors for powerpc. Workround for Google ref b/6663281 +if {[istarget powerpc*-*-*]} { + set profile_option "$profile_option -fno-section-anchors" + set feedback_option "$feedback_option -fno-section-anchors" +} + +foreach src [lsort [glob -nocomplain $srcdir/$subdir/*_0.C]] { + # If we're only testing specific files and this isn't one of them, skip it. + if ![runtest_file_p $runtests $src] then { + continue + } + profopt-execute $src +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition1_0.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition1_0.C new file mode 100644 index 000000000..108803997 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition1_0.C @@ -0,0 +1,54 @@ +/* { dg-require-effective-target freorder } */ +/* { dg-options "-O2 -freorder-blocks-and-partition" } */ +/* { dg-skip-if "PR target/47683" { mips-sgi-irix* } } */ + +struct A { A () __attribute__((noinline)); ~A () __attribute__((noinline)); }; +A::A () { asm volatile ("" : : : "memory"); } +A::~A () { asm volatile ("" : : : "memory"); } + +int bar () __attribute__((noinline)); +void foo () __attribute__((noinline)); + +volatile int k, l; + +int bar (int i) +{ + void *p = __builtin_alloca (i); + asm volatile ("" : : "r" (i), "r" (p) : "memory"); + if (k) throw 6; + return ++l; +} + +void foo () +{ + A a; + try { + A b; + int i = bar (5); + try { throw 6; } catch (int) {} + if (__builtin_expect (i < 4500, 0)) { + bar (7); + try { bar (8); } catch (long) {} + bar (10); + if (__builtin_expect (i < 0, 0)) { + try { bar (12); } catch (...) {} + bar (16); + bar (122); + } else { + try { bar (bar (7)); } catch (int) {} + } + } else { + try { bar (bar (bar (9))); } catch (...) {} + bar (5); + } + } catch (...) { + } +} + +int +main () +{ + int i; + for (i = 0; i < 10000; i++) + foo (); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition2_0.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition2_0.C new file mode 100644 index 000000000..6715da57e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition2_0.C @@ -0,0 +1,16 @@ +// PR middle-end/45458 +// { dg-require-effective-target freorder } +// { dg-options "-fnon-call-exceptions -freorder-blocks-and-partition" } +// { dg-skip-if "PR target/47683" { mips-sgi-irix* } } + +int +main () +{ + try + { + throw 6; + } + catch (...) + { + } +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition3_0.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition3_0.C new file mode 100644 index 000000000..784698369 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/partition3_0.C @@ -0,0 +1,18 @@ +// PR middle-end/45566 +// { dg-require-effective-target freorder } +// { dg-options "-O -fnon-call-exceptions -freorder-blocks-and-partition" } + +int k; + +int +main () +{ + try + { + if (k) + throw 6; + } + catch (...) + { + } +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_0.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_0.C new file mode 100644 index 000000000..3052344b5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_0.C @@ -0,0 +1,41 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ +#include +struct A { + A () {} + virtual int AA (void) { return 0; } +}; + +extern A* getB (void); +extern A* getC (void); + +int g; + +int +main (void) +{ + A* p; + int i; + int s = 0; + + p = getB(); + for (i = 0; i < 100; i++) + { + s += p->AA(); + } + + for (i = 0; i < 100; i++) + { + if (i%10 == 0) + p = getB(); + else + p = getC(); + + s += p->AA(); + } + printf ("result = %d\n",s); +} + +/* { dg-final-use { scan-ipa-dump-times "Indirect call -> direct call" 2 "profile" } } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized" } } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_1.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_1.C new file mode 100644 index 000000000..6023024f4 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_1.C @@ -0,0 +1,23 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ + +struct A { + A () {} + + virtual int AA (void) + { return 0; } + +}; + +struct B : public A { + B () {} + + virtual int AA (void) + { return 1; } +}; + +B b; + +A* getB (void) +{ + return &b; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_2.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_2.C new file mode 100644 index 000000000..cc33d6a19 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/lipo/vcall1_2.C @@ -0,0 +1,31 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ + +struct A { + A () {} + + virtual int AA (void) + { return 0; } + +}; + +struct B : public A { + B () {} + + virtual int AA (void) + { return 1; } +}; + +struct C : public B { + C () {} + + virtual int AA (void) + { return 2; } + +}; + +C c; + +A* getC(void) +{ + return &c; +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/morefunc.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/morefunc.C new file mode 100644 index 000000000..d5cee40cd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/morefunc.C @@ -0,0 +1,55 @@ +/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile -Wno-attributes -Wno-coverage-mismatch" } */ +#include "reorder_class1.h" +#include "reorder_class2.h" + +int g; + +#ifdef _PROFILE_USE +/* Another function not existing + * in profile-gen */ + +__attribute__((noinline)) void +new_func (int i) +{ + g += i; +} +#endif + +static __attribute__((always_inline)) +void test1 (A *tc) +{ + int i; + for (i = 0; i < 1000; i++) + g += tc->foo(); + if (g<100) g++; +} + +static __attribute__((always_inline)) +void test2 (B *tc) +{ + int i; + for (i = 0; i < 1000; i++) + g += tc->foo(); +} + + +__attribute__((noinline)) void test_a(A *ap) { test1 (ap); } +__attribute__((noinline)) void test_b(B *bp) { test2 (bp); } + + +int main() +{ + A* ap = new A(); + B* bp = new B(); + + test_a(ap); + test_b(bp); + +#ifdef _PROFILE_USE + new_func(10); +#endif + +} + +/* { dg-final-use { scan-ipa-dump-times "Indirect call -> direct call" 2 "profile" } } */ + diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder.C new file mode 100644 index 000000000..f0efc210a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder.C @@ -0,0 +1,48 @@ +/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile -Wno-attributes" } */ + +#ifdef _PROFILE_USE +#include "reorder_class1.h" +#include "reorder_class2.h" +#else +#include "reorder_class2.h" +#include "reorder_class1.h" +#endif + +int g; +static __attribute__((always_inline)) +void test1 (A *tc) +{ + int i; + for (i = 0; i < 1000; i++) + g += tc->foo(); + if (g<100) g++; +} + +static __attribute__((always_inline)) +void test2 (B *tc) +{ + int i; + for (i = 0; i < 1000; i++) + g += tc->foo(); +} + + +#ifdef _PROFILE_USE +__attribute__((noinline)) void test_a(A *ap) { test1 (ap); } +__attribute__((noinline)) void test_b(B *bp) { test2 (bp); } +#else +__attribute__((noinline)) void test_b(B *bp) { test2 (bp); } +__attribute__((noinline)) void test_a(A *ap) { test1 (ap); } +#endif + +int main() +{ + A* ap = new A(); + B* bp = new B(); + + test_a(ap); + test_b(bp); +} + +/* { dg-final-use { scan-ipa-dump-times "Indirect call -> direct call" 2 "profile" } } */ + diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder_class1.h b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder_class1.h new file mode 100644 index 000000000..62a1e923c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder_class1.h @@ -0,0 +1,11 @@ +struct A { + virtual int foo(); +}; + +int A::foo() +{ + return 1; +} + + + diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder_class2.h b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder_class2.h new file mode 100644 index 000000000..ee3ed109b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/reorder_class2.h @@ -0,0 +1,12 @@ + +struct B { + virtual int foo(); +}; + +int B::foo() +{ + return 2; +} + + + diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp index 2c96ee38c..f12ddaf86 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp @@ -42,8 +42,8 @@ set PROFOPT_OPTIONS [list {}] # These are globals used by profopt-execute. The first is options # needed to generate profile data, the second is options to use the # profile data. -set profile_option "-fprofile-generate" -set feedback_option "-fprofile-use" +set profile_option "-fprofile-generate -D_PROFILE_GENERATE" +set feedback_option "-fprofile-use -D_PROFILE_USE" foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.C]] { # If we're only testing specific files and this isn't one of them, skip it. diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/forwprop-switch.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/forwprop-switch.C new file mode 100644 index 000000000..c3f12ac45 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/forwprop-switch.C @@ -0,0 +1,24 @@ +// { dg-do compile } +// { dg-options "-O -fdump-tree-cddce1" } + +enum Scale { E1, E2, E3, E4, E5, E6, E7, E8 }; + +int Test(Scale s) +{ + switch(s) + { + case E1: return 12; + case E2: return 17; + case E3: return 22; + case E4: return 42; + default: break; + } + return 0; +} + +// tree forwprop should have eliminated the (int) s cast for the +// switch value and directly switch on the 's' parameter + +// { dg-final { scan-tree-dump-not "\\\(int\\\)" "cddce1" } } +// { dg-final { scan-tree-dump "switch \\\(s_.\\\(D\\\)\\\)" "cddce1" } } +// { dg-final { cleanup-tree-dump "cddce1" } } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr61009.C b/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr61009.C new file mode 100644 index 000000000..4e7bb1a1c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr61009.C @@ -0,0 +1,53 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-vrp -std=c++11 -fno-strict-aliasing -fdump-tree-dom1" } */ + +#include +struct Field { + virtual int Compare(void*, void*); +}; +extern int NKF, NR; +extern int idxs[]; +extern Field* the_field; +extern int *incs; +extern char** fptrs; +inline int doCmp(int this_row_offset, int field_idx) { + void *p = fptrs[field_idx] + this_row_offset * incs[field_idx]; + return the_field->Compare(p,0); +} +bool Test(void) { + + int row_offset = 0; + + for (; row_offset < NR; ++row_offset) { + + bool is_different = false; + for (int j = 0; j < NKF ; ++j) { + int field_idx = idxs[j]; + int cmp = doCmp(row_offset, field_idx); + fprintf (stderr, "cmp=%d\n",cmp); + + if (cmp == 0) { + continue; + } + if (cmp > 0) { + is_different = true; + break; + } else { + fprintf (stderr, "Incorrect\n"); + return false; + } + } + if (!is_different) { + + return false; + } + } + + return true; +} + +// The block ending with cmp == 0 should not be threaded. ie, +// there should be a single == 0 comparison in the dump file. + +// { dg-final { scan-tree-dump-times "== 0" 1 "dom1" } } +// { dg-final { cleanup-tree-dump "dom1" } } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/vect/pr60836.cc b/gcc-4.9/gcc/testsuite/g++.dg/vect/pr60836.cc new file mode 100644 index 000000000..83bb18375 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/vect/pr60836.cc @@ -0,0 +1,39 @@ +// { dg-do compile } + +int a, b; +typedef double (*NormFunc) (const int &); +int & +max (int &p1, int &p2) +{ + if (p1 < p2) + return p2; + return p1; +} + +struct A +{ + int operator () (int p1, int p2) + { + return max (p1, p2); + } +}; +template < class, class > double +norm_ (const int &) +{ + char c, d; + A e; + for (; a; a++) + { + b = e (b, d); + b = e (b, c); + } +} + +void +norm () +{ + static NormFunc f = norm_ < int, A >; + f = 0; +} + +// { dg-final { cleanup-tree-dump "vect" } } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Weff1.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Weff1.C deleted file mode 100644 index a00dc29bf..000000000 --- a/gcc-4.9/gcc/testsuite/g++.dg/warn/Weff1.C +++ /dev/null @@ -1,5 +0,0 @@ -// { dg-options "-Weffc++" } - -struct S {}; -/* Base classes should have virtual destructors. */ -struct T : public S {}; // { dg-warning "" } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-1.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-1.C index 84a1d380b..ff82fd44a 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-1.C +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-1.C @@ -3,7 +3,7 @@ #include -void func1(int* ptr); +void func1 (int *ptr); void func2() { int* t = false; // { dg-warning "converting 'false' to pointer" } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C index 92a87d1e7..6ce7605c5 100644 --- a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C @@ -3,43 +3,53 @@ #include -class Foo { - public: - template - static void Compare(const T1& expected, const T2& actual) { } +class Foo +{ +public: + template < typename T1, typename T2 > + static void Compare (const T1 & expected, const T2 & actual) + { + } - template - static void Compare(const T1& expected, T2* actual) { } + template < typename T1, typename T2 > + static void Compare (const T1 & expected, T2 * actual) + { + } }; -template -class Foo2 { - public: - Foo2(int x); - template void Bar(T2 y); +template < typename T1 > class Foo2 +{ +public: + Foo2 (int x); + template < typename T2 > void Bar (T2 y); }; -template void func(T3 x) { } +template < typename T3 > void +func (T3 x) +{ +} -typedef Foo2 MyFooType; +typedef Foo2 < int >MyFooType; -void func1(long int a) { - MyFooType *foo2 = new MyFooType(NULL); // { dg-warning "passing NULL to" } - foo2->Bar(a); - func(NULL); - func(NULL); // { dg-warning "passing NULL to" } - func(NULL); +void +func1 (long int a) +{ + MyFooType *foo2 = new MyFooType (NULL); // { dg-warning "passing NULL to" } + foo2->Bar (a); + func (NULL); + func < int >(NULL); // { dg-warning "passing NULL to" } + func < int *>(NULL); } int x = 1; -main() +main () { int *p = &x; - Foo::Compare(0, *p); - Foo::Compare(NULL, p); // { dg-warning "passing NULL to" } - Foo::Compare(NULL, p); - func1(NULL); // { dg-warning "passing NULL to" } + Foo::Compare (0, *p); + Foo::Compare < long int, int >(NULL, p); // { dg-warning "passing NULL to" } + Foo::Compare (NULL, p); + func1 (NULL); // { dg-warning "passing NULL to" } } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-1.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-1.C new file mode 100644 index 000000000..f15280501 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-1.C @@ -0,0 +1,54 @@ +// Test the self-assignemnt detection and warning. +// { dg-do compile } +// { dg-options "-Wself-assign" } + +class Foo { + private: + int a_; + + public: + Foo() : a_(a_) {} // { dg-warning "assigned to itself" } + + void setA(int a) { + a_ = a_; // { dg-warning "assigned to itself" } + } + + void operator=(Foo& rhs) { + this->a_ = rhs.a_; + } +}; + +struct Bar { + int b_; + int c_; +}; + +int g = g; // { dg-warning "assigned to itself" } +Foo foo = foo; // { dg-warning "assigned to itself" } + +int func() +{ + Bar *bar1, bar2; + Foo local_foo; + int x = x; // { dg-warning "assigned to itself" } + static int y = y; // { dg-warning "assigned to itself" } + float *f; + Bar bar_array[5]; + char n; + int overflow; + + *f = *f; // { dg-warning "assigned to itself" } + bar1->b_ = bar1->b_; // { dg-warning "assigned to itself" } + bar2.c_ = bar2.c_; // { dg-warning "assigned to itself" } + local_foo = local_foo; + foo = foo; + foo.setA(5); + bar_array[3].c_ = bar_array[3].c_; // { dg-warning "assigned to itself" } + bar_array[x+g].b_ = bar_array[x+g].b_; // { dg-warning "assigned to itself" } + y = x; + x = y; + x += 0; // should not warn + y -= 0; // should not warn + x /= x; // should not warn + y *= y; // should not warn +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-3.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-3.C new file mode 100644 index 000000000..bc5732de9 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-3.C @@ -0,0 +1,35 @@ +// Test how operands_equal_p handles a NULL operand. +// { dg-do compile } +// { dg-options "-Wself-assign" } + +#include + +namespace testing { + +class Foo { + int f; + public: + Foo() { printf("Construct Foo\n"); } +}; + +class Bar { + int b; + public: + Bar(int x) { printf("Construct Bar\n"); } + + void operator=(const Foo& foo) { + printf("Assign Foo to Bar\n"); + } +}; + +} + +template +void func(T t) { + ::testing::Bar(1) = ::testing::Foo(); // used to trigger a segfault + ::testing::Foo() = ::testing::Foo(); +} + +main() { + func(2); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-4.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-4.C new file mode 100644 index 000000000..abe96b55d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-4.C @@ -0,0 +1,48 @@ +// Test how self-assignment detection handles constant-folding happening +// when parsing the RHS or the initializer. +// { dg-do compile } +// { dg-options "-Wself-assign" } + +class Foo { + private: + int a_; + + public: + Foo() : a_(a_+0) {} // should not warn + + void setA(int a) { + a_ = a_ + 0; // should not warn + } + + void operator=(Foo& rhs) { + this->a_ = rhs.a_; + } +}; + +struct Bar { + int b_; + float c_; +}; + +int g = g * 1; // should not warn + +int func() +{ + Bar *bar1, bar2; + Foo foo; + int x = x - 0; // should not warn + static int y = y / 1; // should not warn + float *f; + Bar bar_array[5]; + + *f = *f / 1; // should not warn + bar1->b_ = bar1->b_ * 1; // should not warn + bar2.c_ = bar2.c_ - 0; // should not warn + foo.setA(5); + bar_array[3].c_ = bar_array[3].c_ * 1; // should not warn + bar_array[x+g].b_ = bar_array[x+g].b_ / 1; // should not warn + x += 0; + y -= 0; + foo = foo; + foo.operator=(foo); // should not warn +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-5.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-5.C new file mode 100644 index 000000000..20df214dd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-5.C @@ -0,0 +1,38 @@ +// Test -Wself-assign does not warn on self-assignment of non-POD variables. +// { dg-do compile } +// { dg-options "-Wself-assign" } + +template +class Foo { + private: + T a_; + public: + Foo() : a_(a_) {} // { dg-warning "assigned to itself" } + void Set() { a_ = a_; } +}; + +struct Bar { + int b_; + int c_; + void operator=(Bar& rhs) { + this->b_ = rhs.b_; + this->c_ = rhs.c_; + } +}; + +template +void func() { + T a; + a = a; +} + +main() +{ + Foo foo; + Bar *bar1, bar2; + func(); + foo = foo; + bar2 = bar2; + bar1 = bar1; // { dg-warning "assigned to itself" } + bar2.b_ = bar2.b_; // { dg-warning "assigned to itself" } +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-1.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-1.C new file mode 100644 index 000000000..6f9dfb73c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-1.C @@ -0,0 +1,54 @@ +// Test the self-assignemnt detection and warning. +// { dg-do compile } +// { dg-options "-Wself-assign -Wself-assign-non-pod" } + +class Foo { + private: + int a_; + + public: + Foo() : a_(a_) {} // { dg-warning "assigned to itself" } + + void setA(int a) { + a_ = a_; // { dg-warning "assigned to itself" } + } + + void operator=(Foo& rhs) { + this->a_ = rhs.a_; + } +}; + +struct Bar { + int b_; + int c_; +}; + +int g = g; // { dg-warning "assigned to itself" } +Foo foo = foo; // { dg-warning "assigned to itself" } + +int func() +{ + Bar *bar1, bar2; + Foo local_foo; + int x = x; // { dg-warning "assigned to itself" } + static int y = y; // { dg-warning "assigned to itself" } + float *f; + Bar bar_array[5]; + char n; + int overflow; + + *f = *f; // { dg-warning "assigned to itself" } + bar1->b_ = bar1->b_; // { dg-warning "assigned to itself" } + bar2.c_ = bar2.c_; // { dg-warning "assigned to itself" } + local_foo = local_foo; // { dg-warning "assigned to itself" } + foo = foo; // { dg-warning "assigned to itself" } + foo.setA(5); + bar_array[3].c_ = bar_array[3].c_; // { dg-warning "assigned to itself" } + bar_array[x+g].b_ = bar_array[x+g].b_; // { dg-warning "assigned to itself" } + y = x; + x = y; + x += 0; // should not warn + y -= 0; // should not warn + x /= x; // should not warn + y *= y; // should not warn +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-3.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-3.C new file mode 100644 index 000000000..4c37f5764 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-3.C @@ -0,0 +1,35 @@ +// Test how operands_equal_p handles a NULL operand. +// { dg-do compile } +// { dg-options "-Wself-assign -Wself-assign-non-pod" } + +#include + +namespace testing { + +class Foo { + int f; + public: + Foo() { printf("Construct Foo\n"); } +}; + +class Bar { + int b; + public: + Bar(int x) { printf("Construct Bar\n"); } + + void operator=(const Foo& foo) { + printf("Assign Foo to Bar\n"); + } +}; + +} + +template +void func(T t) { + ::testing::Bar(1) = ::testing::Foo(); // used to trigger a segfault + ::testing::Foo() = ::testing::Foo(); // { dg-warning "assigned to itself" } +} + +main() { + func(2); +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-4.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-4.C new file mode 100644 index 000000000..86db4e3c6 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-4.C @@ -0,0 +1,48 @@ +// Test how self-assignment detection handles constant-folding happening +// when parsing the RHS or the initializer. +// { dg-do compile } +// { dg-options "-Wself-assign -Wself-assign-non-pod" } + +class Foo { + private: + int a_; + + public: + Foo() : a_(a_+0) {} // should not warn + + void setA(int a) { + a_ = a_ + 0; // should not warn + } + + void operator=(Foo& rhs) { + this->a_ = rhs.a_; + } +}; + +struct Bar { + int b_; + float c_; +}; + +int g = g * 1; // should not warn + +int func() +{ + Bar *bar1, bar2; + Foo foo; + int x = x - 0; // should not warn + static int y = y / 1; // should not warn + float *f; + Bar bar_array[5]; + + *f = *f / 1; // should not warn + bar1->b_ = bar1->b_ * 1; // should not warn + bar2.c_ = bar2.c_ - 0; // should not warn + foo.setA(5); + bar_array[3].c_ = bar_array[3].c_ * 1; // should not warn + bar_array[x+g].b_ = bar_array[x+g].b_ / 1; // should not warn + x += 0; + y -= 0; + foo = foo; // { dg-warning "assigned to itself" } + foo.operator=(foo); // should not warn +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-5.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-5.C new file mode 100644 index 000000000..898ddecd7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wself-assign-non-pod-5.C @@ -0,0 +1,38 @@ +// Test -Wself-assign and -Wself-assign-non-pod. +// { dg-do compile } +// { dg-options "-Wself-assign -Wself-assign-non-pod" } + +template +class Foo { + private: + T a_; + public: + Foo() : a_(a_) {} // { dg-warning "assigned to itself" } + void Set() { a_ = a_; } // { dg-warning "assigned to itself" } +}; + +struct Bar { + int b_; + int c_; + void operator=(Bar& rhs) { + this->b_ = rhs.b_; + this->c_ = rhs.c_; + } +}; + +template +void func() { + T a; + a = a; // { dg-warning "assigned to itself" } +} + +main() +{ + Foo foo; + Bar *bar1, bar2; + func(); + foo = foo; // { dg-warning "assigned to itself" } + bar2 = bar2; // { dg-warning "assigned to itself" } + bar1 = bar1; // { dg-warning "assigned to itself" } + bar2.b_ = bar2.b_; // { dg-warning "assigned to itself" } +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-compatible-local-1.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-compatible-local-1.C new file mode 100644 index 000000000..e251b724e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-compatible-local-1.C @@ -0,0 +1,63 @@ +/* { dg-do compile } */ +/* { dg-options -Wshadow-compatible-local } */ + +class Bar { +}; + +class ChildBar : public Bar { +}; + +Bar bar; + +class Foo { + private: + int val; + + public: + int func1(int x) { + int val; + val = x; + return val; + } + + int func2(int i) { // { dg-warning "shadowed declaration" } + int a = 3; // { dg-warning "shadowed declaration" } + + for (int i = 0; i < 5; ++i) { // { dg-warning "shadows a parameter" } + for (int i = 0; i < 3; ++i) { // { dg-warning "shadows a previous local" } + int a = i; // { dg-warning "shadows a previous local" } + func1(a); + } + } + + return a; + } + + int func3() { + int bar; + float func1 = 0.3; + int f = 5; // { dg-warning "shadowed declaration" } + + if (func1 > 1) { + float f = 2.0; // { dg-warning "shadows a previous local" } + bar = f; + } + else + bar = 1; + return bar; + } + + void func4() { + Bar *bar; // { dg-bogus "shadowed declaration" } + ChildBar *cbp; // { dg-bogus "shadowed declaration" } + Bar *bp; // { dg-warning "shadowed declaration" } + if (val) { + int bar; // { dg-bogus "shadows a previous local" } + Bar *cbp; // { dg-bogus "shadows a previous local" } + ChildBar *bp; // { dg-warning "shadows a previous local" } + func1(bar); + } + } +}; + +// { dg-warning "shadowed declaration" "" { target *-*-* } 26 } diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-local-1.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-local-1.C new file mode 100644 index 000000000..24a5bc223 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-local-1.C @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options -Wshadow-local } */ + +struct status +{ + int member; + void foo2 (); + + inline static int foo3 (int member) + { + return member; + } +}; + +int decl1; // { dg-bogus "shadowed declaration" } +int decl2; // { dg-bogus "shadowed declaration" } +void foo (struct status &status, + double decl1) // { dg-bogus "shadows a global" } +{ +} + +void foo1 (int d) +{ + double d; // { dg-error "shadows a parameter" } +} + +void status::foo2 () +{ + int member; // { dg-bogus "shadows a member" } + int decl2; // { dg-bogus "shadows a global" } + int local; // { dg-warning "shadowed declaration" } + { + int local; // { dg-warning "shadows a previous local" } + } +} diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-local-2.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-local-2.C new file mode 100644 index 000000000..ac3951ebc --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wshadow-local-2.C @@ -0,0 +1,63 @@ +/* { dg-do compile } */ +/* { dg-options -Wshadow-local } */ + +class Bar { +}; + +class ChildBar : public Bar { +}; + +Bar bar; // { dg-bogus "shadowed declaration" } + +class Foo { + private: + int val; + + public: + int func1(int x) { + int val; // { dg-bogus "shadows a member" } + val = x; + return val; + } + + int func2(int i) { // { dg-warning "shadowed declaration" } + int a = 3; // { dg-warning "shadowed declaration" } + + for (int i = 0; i < 5; ++i) { // { dg-warning "shadows a parameter" } + for (int i = 0; i < 3; ++i) { // { dg-warning "shadows a previous local" } + int a = i; // { dg-warning "shadows a previous local" } + func1(a); + } + } + + return a; + } + + int func3() { + int bar; // { dg-bogus "shadows a global" } + float func1 = 0.3; // { dg-bogus "shadows a member" } + int f = 5; // { dg-warning "shadowed declaration" } + + if (func1 > 1) { + float f = 2.0; // { dg-warning "shadows a previous local" } + bar = f; + } + else + bar = 1; + return bar; + } + + void func4() { + Bar *bar; // { dg-warning "shadowed declaration" } + ChildBar *cbp; // { dg-warning "shadowed declaration" } + Bar *bp; // { dg-warning "shadowed declaration" } + if (val) { + int bar; // { dg-warning "shadows a previous local" } + Bar *cbp; // { dg-warning "shadows a previous local" } + ChildBar *bp; // { dg-warning "shadows a previous local" } + func1(bar); + } + } +}; + +// { dg-warning "shadowed declaration" "" { target *-*-* } 26 } diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.benjamin/15309-1.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.benjamin/15309-1.C deleted file mode 100644 index aa5530fff..000000000 --- a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.benjamin/15309-1.C +++ /dev/null @@ -1,21 +0,0 @@ -// { dg-do assemble } -// { dg-options "-Wnon-virtual-dtor -Weffc++" } -// 981203 bkoz -// g++/15309 - -class bahamian { -public: - bahamian (); - ~bahamian (); -}; - -class miami : public bahamian // { dg-warning "" } // WARNING - -{ -public: - miami (); - ~miami (); -}; - - - - diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.benjamin/15309-2.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.benjamin/15309-2.C deleted file mode 100644 index 283179731..000000000 --- a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.benjamin/15309-2.C +++ /dev/null @@ -1,10 +0,0 @@ -// { dg-do assemble } -// { dg-options "-Wnon-virtual-dtor -Weffc++" } -// 981203 bkoz -// g++/15309 - -class bermuda { // { dg-warning "" } // WARNING - -public: - virtual int func1(int); - ~bermuda(); -}; diff --git a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.ext/memconst.C b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.ext/memconst.C index d9347635c..7e861563c 100644 --- a/gcc-4.9/gcc/testsuite/g++.old-deja/g++.ext/memconst.C +++ b/gcc-4.9/gcc/testsuite/g++.old-deja/g++.ext/memconst.C @@ -1,5 +1,5 @@ // { dg-do assemble } -// { dg-options "" } +// { dg-options "-pedantic -pedantic-errors" } // From: Ove.Ewerlid@syscon.uu.se (Ove Ewerlid) // Subject: ss-940630:cc1plus: internal error // Date: Sat, 2 Jul 1994 05:07:20 +0200 diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr61684.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr61684.c new file mode 100644 index 000000000..f5b53b73a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr61684.c @@ -0,0 +1,15 @@ +/* PR tree-optimization/61684 */ + +int a, c; +static int *b = 0; +short d; +static short **e = 0; + +void +foo () +{ + for (; c < 1; c++) + ; + *e = &d; + a = d && (c && 1) & *b; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20140425-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20140425-1.c new file mode 100644 index 000000000..c447ef95b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/20140425-1.c @@ -0,0 +1,23 @@ +/* PR target/60941 */ +/* Reported by Martin Husemann */ + +extern void abort (void); + +static void __attribute__((noinline)) +set (unsigned long *l) +{ + *l = 31; +} + +int main (void) +{ + unsigned long l; + int i; + + set (&l); + i = (int) l; + l = (unsigned long)(2U << i); + if (l != 0) + abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr60960.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr60960.c new file mode 100644 index 000000000..b4f08d4c5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr60960.c @@ -0,0 +1,38 @@ +/* PR tree-optimization/60960 */ + +typedef unsigned char v4qi __attribute__ ((vector_size (4))); + +__attribute__((noinline, noclone)) v4qi +f1 (v4qi v) +{ + return v / 2; +} + +__attribute__((noinline, noclone)) v4qi +f2 (v4qi v) +{ + return v / (v4qi) { 2, 2, 2, 2 }; +} + +__attribute__((noinline, noclone)) v4qi +f3 (v4qi x, v4qi y) +{ + return x / y; +} + +int +main () +{ + v4qi x = { 5, 5, 5, 5 }; + v4qi y = { 2, 2, 2, 2 }; + v4qi z = f1 (x); + if (__builtin_memcmp (&y, &z, sizeof (y)) != 0) + __builtin_abort (); + z = f2 (x); + if (__builtin_memcmp (&y, &z, sizeof (y)) != 0) + __builtin_abort (); + z = f3 (x, y); + if (__builtin_memcmp (&y, &z, sizeof (y)) != 0) + __builtin_abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c new file mode 100644 index 000000000..ebc90a32f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c @@ -0,0 +1,39 @@ +#ifdef __INT32_TYPE__ +typedef __INT32_TYPE__ int32_t; +#else +typedef int int32_t; +#endif + +#ifdef __UINT32_TYPE__ +typedef __UINT32_TYPE__ uint32_t; +#else +typedef unsigned uint32_t; +#endif + +#define __fake_const_swab32(x) ((uint32_t)( \ + (((uint32_t)(x) & (uint32_t)0x000000ffUL) << 24) | \ + (((uint32_t)(x) & (uint32_t)0x0000ff00UL) << 8) | \ + (((uint32_t)(x) & (uint32_t)0x00ff0000UL) >> 8) | \ + (( (int32_t)(x) & (int32_t)0xff000000UL) >> 24))) + +/* Previous version of bswap optimization failed to consider sign extension + and as a result would replace an expression *not* doing a bswap by a + bswap. */ + +__attribute__ ((noinline, noclone)) uint32_t +fake_bswap32 (uint32_t in) +{ + return __fake_const_swab32 (in); +} + +int +main(void) +{ + if (sizeof (int32_t) * __CHAR_BIT__ != 32) + return 0; + if (sizeof (uint32_t) * __CHAR_BIT__ != 32) + return 0; + if (fake_bswap32 (0x87654321) != 0xffffff87) + __builtin_abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c new file mode 100644 index 000000000..886ecfd29 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c @@ -0,0 +1,40 @@ +#ifdef __INT16_TYPE__ +typedef __INT16_TYPE__ int16_t; +#else +typedef short int16_t; +#endif + +#ifdef __UINT32_TYPE__ +typedef __UINT32_TYPE__ uint32_t; +#else +typedef unsigned uint32_t; +#endif + +#define __fake_const_swab32(x) ((uint32_t)( \ + (((uint32_t) (x) & (uint32_t)0x000000ffUL) << 24) | \ + (((uint32_t)(int16_t)(x) & (uint32_t)0x00ffff00UL) << 8) | \ + (((uint32_t) (x) & (uint32_t)0x00ff0000UL) >> 8) | \ + (((uint32_t) (x) & (uint32_t)0xff000000UL) >> 24))) + + +/* Previous version of bswap optimization failed to consider sign extension + and as a result would replace an expression *not* doing a bswap by a + bswap. */ + +__attribute__ ((noinline, noclone)) uint32_t +fake_bswap32 (uint32_t in) +{ + return __fake_const_swab32 (in); +} + +int +main(void) +{ + if (sizeof (uint32_t) * __CHAR_BIT__ != 32) + return 0; + if (sizeof (int16_t) * __CHAR_BIT__ != 16) + return 0; + if (fake_bswap32 (0x81828384) != 0xff838281) + __builtin_abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c new file mode 100644 index 000000000..6086e2786 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c @@ -0,0 +1,13 @@ +short a = -1; +int b; +char c; + +int +main () +{ + c = a; + b = a | c; + if (b != -1) + __builtin_abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61673.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61673.c new file mode 100644 index 000000000..b3e243da5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61673.c @@ -0,0 +1,50 @@ +/* PR rtl-optimization/61673 */ + +char e; + +__attribute__((noinline, noclone)) void +bar (char x) +{ + if (x != 0x54 && x != (char) 0x87) + __builtin_abort (); +} + +__attribute__((noinline, noclone)) void +foo (const char *x) +{ + char d = x[0]; + int c = d; + if ((c >= 0 && c <= 0x7f) == 0) + e = d; + bar (d); +} + +__attribute__((noinline, noclone)) void +baz (const char *x) +{ + char d = x[0]; + int c = d; + if ((c >= 0 && c <= 0x7f) == 0) + e = d; +} + +int +main () +{ + const char c[] = { 0x54, 0x87 }; + e = 0x21; + foo (c); + if (e != 0x21) + __builtin_abort (); + foo (c + 1); + if (e != (char) 0x87) + __builtin_abort (); + e = 0x21; + baz (c); + if (e != 0x21) + __builtin_abort (); + baz (c + 1); + if (e != (char) 0x87) + __builtin_abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61725.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61725.c new file mode 100644 index 000000000..0aa6dafa2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/execute/pr61725.c @@ -0,0 +1,14 @@ +/* PR tree-optimization/61725 */ + +int +main () +{ + int x; + for (x = -128; x <= 128; x++) + { + int a = __builtin_ffs (x); + if (x == 0 && a != 0) + __builtin_abort (); + } + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-compatible-local-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-compatible-local-1.c new file mode 100644 index 000000000..cb21be9ae --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-compatible-local-1.c @@ -0,0 +1,36 @@ +/* { dg-do compile } */ +/* { dg-options "-Wshadow-compatible-local" } */ + +struct Bar { +}; + +struct Bar bar; /* { dg-bogus "shadowed declaration" } */ + +int val; /* { dg-bogus "shadowed declaration" } */ + +int func1(int x) { /* { dg-bogus "shadowed declaration" } */ + int val; /* { dg-bogus "shadows a global" } */ + val = x; + return val; +} + +int func2(int i) { + int a = 3; /* { dg-warning "shadowed declaration" } */ + int j; /* { dg-warning "shadowed declaration" } */ + + for (j = 0; j < i; ++j) { + int a = j; /* { dg-warning "shadows a previous local" } */ + int j = a + 1; /* { dg-warning "shadows a previous local" } */ + func1(j); + } + + return a; +} + +void func4() { + struct Bar bar; /* { dg-bogus "shadowed declaration" } */ + if (val) { + int bar; /* { dg-bogus "shadows a previous local" } */ + func1(bar); + } +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-1.c new file mode 100644 index 000000000..b21661ef8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-1.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-Wshadow-local" } */ + +int decl1; /* should not warn */ +void foo (double decl1) /* should not warn */ +{ +} + +void foo2 (int d) /* { dg-warning "shadowed declaration" } */ +{ + { + double d; /* { dg-warning "shadows a parameter" } */ + } +} + +void foo3 () +{ + int local; /* { dg-warning "shadowed declaration" } */ + { + int local; /* { dg-warning "shadows a previous local" } */ + } +} +/* { dg-do compile } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-2.c new file mode 100644 index 000000000..9d52fac6f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-2.c @@ -0,0 +1,49 @@ +/* { dg-do compile } */ +/* { dg-options "-Wshadow-local" } */ + +struct Bar { +}; + +struct Bar bar; /* { dg-bogus "shadowed declaration" } */ + +int val; /* { dg-bogus "shadowed declaration" } */ + +int func1(int x) { /* { dg-bogus "shadowed declaration" } */ + int val; /* { dg-bogus "shadows a global" } */ + val = x; + return val; +} + +int func2(int i) { + int a = 3; /* { dg-warning "shadowed declaration" } */ + int j; /* { dg-warning "shadowed declaration" } */ + + for (j = 0; j < i; ++j) { + int a = j; /* { dg-warning "shadows a previous local" } */ + int j = a + 1; /* { dg-warning "shadows a previous local" } */ + func1(j); + } + + return a; +} + +int func3() { + int bar; /* { dg-bogus "shadows a global" } */ + float func1 = 0.3; /* { dg-bogus "shadows a global" } */ + + if (func1 > 1) + bar = 2; + else + bar = 1; + return bar; +} + +void func4() { + struct Bar bar; /* { dg-warning "shadowed declaration" } */ + if (val) { + int bar; /* { dg-warning "shadows a previous local" } */ + func1(bar); + } +} + +/* { dg-bogus "shadows a global" "" { target *-*-* } 42 } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-3.c new file mode 100644 index 000000000..429df37f5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/Wshadow-local-3.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-Wno-shadow" } */ + +void func() { + int i; + { + int i; /* should not warn */ + } +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-1.c index a9d2185f0..2e4faf44b 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-1.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ void abort (void); diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-3.c index c6e0adbff..755b9da4d 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ void abort (void); diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-4.c index d60023f5d..0feac6897 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-4.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-4.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ void abort (void); diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-5.c index fa8029326..f6cd97093 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-5.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/outer-5.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ void abort (void); diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/parallelization-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/parallelization-1.c index de2a0f3cc..fe77a92e8 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/parallelization-1.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/parallelization-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ void abort (void); diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1.c index 8018a558c..9bb1b5761 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1char.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1char.c index 76645c850..832202008 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1char.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1char.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1short.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1short.c index 526f17009..5a2efa871 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1short.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-1short.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2.c index e0abb265b..8c9fb03a0 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2char.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2char.c index ada1275f9..cff542511 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2char.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2char.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2short.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2short.c index 3363c68f4..5ee5f014d 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2short.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-2short.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-3.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-3.c index 6bc204711..c9ec27b89 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-6.c index fface8fed..5d495e34a 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-6.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-6.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-7.c index f66069e56..72a36ad9b 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-7.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-8.c index 4a416df23..662ff44cb 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-8.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-8.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-9.c index 2c1677ce5..c738f2300 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-9.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/autopar/reduc-9.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */ #include diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt1.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt1.c new file mode 100644 index 000000000..b916e69cf --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt1.c @@ -0,0 +1,32 @@ +/* Test that -g1 includes line tables and inlined subroutine entries, + and excludes types and variables. */ +/* Origin: Cary Coutant */ +/* { dg-do compile } */ +/* { dg-options "-O2 -gdwarf-2 -dA -g1" } */ +/* { dg-final { scan-assembler "DW_AT_stmt_list" } } */ +/* { dg-final { scan-assembler "DW_TAG_subprogram" } } */ +/* { dg-final { scan-assembler "DW_TAG_inlined_subroutine" } } */ +/* { dg-final { scan-assembler-not "DW_TAG_variable" } } */ +/* { dg-final { scan-assembler-not "DW_TAG_formal_parameter" } } */ +/* { dg-final { scan-assembler-not "DW_TAG_base_type" } } */ + +static inline __attribute__((always_inline)) int +a(int i, int j) +{ + return (i << 5) + j; +} + +int +b(int i, int j) +{ + return (i >> 5) + (j << 27); +} + +int +c(int i, int j) +{ + int r = a(i, j); + r = b(r, i); + r = b(r, j); + return r; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt2.c b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt2.c new file mode 100644 index 000000000..2fd5b0f22 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/debug/dwarf2/mlt2.c @@ -0,0 +1,31 @@ +/* Test that -g overrides -g1. */ +/* Origin: Cary Coutant */ +/* { dg-do compile } */ +/* { dg-options "-O2 -gdwarf-2 -dA -g1 -g" } */ +/* { dg-final { scan-assembler "DW_AT_stmt_list" } } */ +/* { dg-final { scan-assembler "DW_TAG_subprogram" } } */ +/* { dg-final { scan-assembler "DW_TAG_inlined_subroutine" } } */ +/* { dg-final { scan-assembler "DW_TAG_variable" } } */ +/* { dg-final { scan-assembler "DW_TAG_formal_parameter" } } */ +/* { dg-final { scan-assembler "DW_TAG_base_type" } } */ + +static inline __attribute__((always_inline)) int +a(int i, int j) +{ + return (i << 5) + j; +} + +int +b(int i, int j) +{ + return (i >> 5) + (j << 27); +} + +int +c(int i, int j) +{ + int r = a(i, j); + r = b(r, i); + r = b(r, j); + return r; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/fstack-protector-strong.c b/gcc-4.9/gcc/testsuite/gcc.dg/fstack-protector-strong.c index 7c232fff2..5a5cf98a7 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/fstack-protector-strong.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/fstack-protector-strong.c @@ -1,9 +1,10 @@ /* Test that stack protection is done on chosen functions. */ -/* { dg-do compile { target i?86-*-* x86_64-*-* rs6000-*-* s390x-*-* } } */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ /* { dg-options "-O2 -fstack-protector-strong" } */ #include +#include extern int g0; extern int* pg0; @@ -109,7 +110,7 @@ foo8 () int foo9 () { - char* p = __builtin_alloca (100); + char* p = alloca (100); return goo ((int *)(p + 50)); } diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr55022.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr55022.c new file mode 100644 index 000000000..c631c0e23 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr55022.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fgraphite-identity" } */ + +extern void abort (void); + +void __attribute__((noinline,noclone)) +f(int *limit, int minLen, int maxLen) +{ + int i; + + for (i = minLen; i <= maxLen; i++) { + limit[i] = i; + } +} + +int main() +{ + int limit[256], i; + f (limit, 0, 255); + for (i = 0; i < 256; ++i) + { + if (limit[i] != i) + abort (); + __asm__ volatile ("" : : : "memory"); + } + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-1.c new file mode 100644 index 000000000..175fa16fd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-1.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -floop-interchange" } */ + +int kd; + +void +n2(void) +{ + static int so; + static short int i5; + int wj; + int *il; + int *nk = &so; + for (wj = 0; wj < 2; ++wj) + *nk = ((i5 += *il) || kd ); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-2.c new file mode 100644 index 000000000..139500768 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr59817-2.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -floop-interchange" } */ + +void +xl(void) +{ + static int j3; + for (j3 = 0; j3 < 1; ++j3) { + static int f2; + static int w7; + short int b5; + int ok; + f2 = (b5 += ok) ? (w7 = 0): (w7 ? 0 : (f2 = ok)); + } +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr60979.c b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr60979.c new file mode 100644 index 000000000..0004a5124 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/graphite/pr60979.c @@ -0,0 +1,37 @@ +/* { dg-options "-O -fgraphite-identity" } */ + +#include + +struct x; + +typedef struct x **(*a)(struct x *); + +struct x { + union { + struct { + union { + a *i; + } l; + int s; + } y; + } e; +}; + +jmp_buf c; + +void +b(struct x *r) +{ + int f; + static int w = 0; + volatile jmp_buf m; + f = (*(((struct x *)r)->e.y.l.i[2]((struct x *)r)))->e.y.s; + if (w++ != 0) + __builtin_memcpy((char *)m, (const char *)c, sizeof(jmp_buf)); + if (setjmp (c) == 0) { + int z; + for (z = 0; z < 0; ++z) + ; + } + d((const char *)m); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.exp index 5e714dd7d..d8e641f81 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.exp +++ b/gcc-4.9/gcc/testsuite/gcc.dg/guality/guality.exp @@ -1,5 +1,8 @@ # This harness is for tests that should be run at all optimisation levels. +# Disable everywhere. These tests are very flaky. +return + load_lib gcc-dg.exp load_lib gcc-gdb-test.exp diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_0.c new file mode 100644 index 000000000..79cef5dad --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_0.c @@ -0,0 +1,15 @@ +/* { dg-lto-do run } */ +/* { dg-extra-ld-options { -w } } */ + +/* ??? lto.exp does not allow to scan for + :1:12: warning: type of 'x' does not match original declaration + extern int x[]; + ^ + :1:5: note: previously declared here + int x; + ^ */ + +extern int x[]; +int *foo[] = { &x[0] }; + +int main() { return *foo[0]; } diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_1.c new file mode 100644 index 000000000..6d1a0d47b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60720_1.c @@ -0,0 +1 @@ +int x; diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60911_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60911_0.c new file mode 100644 index 000000000..e4820a204 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr60911_0.c @@ -0,0 +1,21 @@ +// { dg-lto-do run } +// { dg-lto-options { { -O2 -flto -fipa-pta } } } + +int __attribute__ ((__noinline__)) f (unsigned *p, int *x) +{ + int y = *p++ & 0xfff; + *x++ = y; + *x = *p; + return y; +} + +int +main () +{ + unsigned u[2] = { 0x3aad, 0x5ad1 }; + int x[2] = { 17689, 23456 }; + + if (f (u, x) != 0xaad || x[0] != 0xaad || x[1] != 0x5ad1) + __builtin_abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_0.c new file mode 100644 index 000000000..6324c8c5b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_0.c @@ -0,0 +1,6 @@ +/* { dg-lto-do link } */ +/* { dg-lto-options { { -fPIC -flto -flto-partition=1to1 } } } */ +/* { dg-extra-ld-options { -shared } } */ + +static void *master; +void *foo () { return master; } diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_1.c new file mode 100644 index 000000000..bb2893b73 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/lto/pr61526_1.c @@ -0,0 +1,2 @@ +extern void *master; +void *bar () { return master; } diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/selfassign.c index 041f25dce..9a0c620dd 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/plugin/selfassign.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/plugin/selfassign.c @@ -211,7 +211,7 @@ compare_and_warn (gimple stmt, tree lhs, tree rhs) /* Check and warn if STMT is a self-assign statement. */ static void -warn_self_assign (gimple stmt) +check_self_assign (gimple stmt) { tree rhs, lhs; @@ -264,7 +264,7 @@ execute_warn_self_assign (void) FOR_EACH_BB_FN (bb, cfun) { for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - warn_self_assign (gsi_stmt (gsi)); + check_self_assign (gsi_stmt (gsi)); } return 0; diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr47793.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr47793.c index 0ee1aaee4..da6b6eab6 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/pr47793.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr47793.c @@ -1,7 +1,6 @@ /* Bug pr47793: Allow relative paths in profile-generate. */ /* { dg-do run } */ /* { dg-options "-O -fprofile-generate=./" } */ -/* { dg-require-profiling "-fprofile-generate" } */ /* { dg-final { scan-file pr47793.gcda "."} } */ int diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr53265.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr53265.c index e1ca6f521..c5ed476ed 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/pr53265.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr53265.c @@ -1,6 +1,6 @@ /* PR tree-optimization/53265 */ /* { dg-do compile } */ -/* { dg-options "-O2 -Wall" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -Wall" } */ /* { dg-require-effective-target size32plus } */ void bar (void *); @@ -155,3 +155,5 @@ fn12 (void) fn11 (1); fn11 (1); } + +/* { dg-prune-output "array subscript is above array bounds" } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c new file mode 100644 index 000000000..58c05348b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr57233.c @@ -0,0 +1,171 @@ +/* PR tree-optimization/57233 */ +/* { dg-do run { target { ilp32 || lp64 } } } */ +/* { dg-options "-O2" } */ + +typedef unsigned V4 __attribute__((vector_size(4 * sizeof (int)))); +typedef unsigned V8 __attribute__((vector_size(8 * sizeof (int)))); +typedef unsigned V16 __attribute__((vector_size(16 * sizeof (int)))); +V4 a, b, g; +V8 c, d, h; +V16 e, f, j; + +__attribute__((noinline)) void +f1 (void) +{ + a = (a << 2) | (a >> 30); +} + +__attribute__((noinline)) void +f2 (void) +{ + a = (a << 30) | (a >> 2); +} + +__attribute__((noinline)) void +f3 (void) +{ + a = (a << b) | (a >> (32 - b)); +} + +__attribute__((noinline, noclone)) void +f4 (int x) +{ + a = (a << x) | (a >> (32 - x)); +} + +__attribute__((noinline)) void +f5 (void) +{ + c = (c << 2) | (c >> 30); +} + +__attribute__((noinline)) void +f6 (void) +{ + c = (c << 30) | (c >> 2); +} + +__attribute__((noinline)) void +f7 (void) +{ + c = (c << d) | (c >> (32 - d)); +} + +__attribute__((noinline, noclone)) void +f8 (int x) +{ + c = (c << x) | (c >> (32 - x)); +} + +__attribute__((noinline)) void +f9 (void) +{ + e = (e << 2) | (e >> 30); +} + +__attribute__((noinline)) void +f10 (void) +{ + e = (e << 30) | (e >> 2); +} + +__attribute__((noinline)) void +f11 (void) +{ + e = (e << f) | (e >> (32 - f)); +} + +__attribute__((noinline, noclone)) void +f12 (int x) +{ + e = (e << x) | (e >> (32 - x)); +} + +unsigned +r (void) +{ + static unsigned x = 0xdeadbeefU; + static unsigned y = 0x12347654U; + static unsigned z = 0x1a2b3c4dU; + static unsigned w = 0x87654321U; + unsigned t = x ^ (x << 11); + x = y; + y = z; + z = w; + w = w ^ (w >> 19) ^ t ^ (t >> 8); + return w; +} + +void +init (unsigned int *p, int count, int mod) +{ + int i; + for (i = 0; i < count; i++) + { + unsigned int v = r (); + if (mod) + v = (v % 31) + 1; + p[i] = v; + } +} + +void +check (unsigned int *p, unsigned int *q, int count, unsigned int *s, int ss) +{ + int i; + for (i = 0; i < count; i++) + { + if (s) + ss = s[i]; + if (p[i] != ((q[i] << ss) | (q[i] >> (32 - ss)))) + __builtin_abort (); + } +} + +int +main () +{ + init ((unsigned int *) &a, 4, 0); + init ((unsigned int *) &b, 4, 1); + init ((unsigned int *) &c, 8, 0); + init ((unsigned int *) &d, 8, 1); + init ((unsigned int *) &e, 16, 0); + init ((unsigned int *) &f, 16, 1); + g = a; + h = c; + j = e; + f1 (); + f5 (); + f9 (); + check ((unsigned int *) &a, (unsigned int *) &g, 4, 0, 2); + check ((unsigned int *) &c, (unsigned int *) &h, 8, 0, 2); + check ((unsigned int *) &e, (unsigned int *) &j, 16, 0, 2); + g = a; + h = c; + j = e; + f2 (); + f6 (); + f10 (); + check ((unsigned int *) &a, (unsigned int *) &g, 4, 0, 30); + check ((unsigned int *) &c, (unsigned int *) &h, 8, 0, 30); + check ((unsigned int *) &e, (unsigned int *) &j, 16, 0, 30); + g = a; + h = c; + j = e; + f3 (); + f7 (); + f11 (); + check ((unsigned int *) &a, (unsigned int *) &g, 4, (unsigned int *) &b, 0); + check ((unsigned int *) &c, (unsigned int *) &h, 8, (unsigned int *) &d, 0); + check ((unsigned int *) &e, (unsigned int *) &j, 16, (unsigned int *) &f, 0); + g = a; + h = c; + j = e; + f4 (5); + f8 (5); + f12 (5); + check ((unsigned int *) &a, (unsigned int *) &g, 4, 0, 5); + check ((unsigned int *) &c, (unsigned int *) &h, 8, 0, 5); + check ((unsigned int *) &e, (unsigned int *) &j, 16, 0, 5); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60844.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60844.c new file mode 100644 index 000000000..16ed243d7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60844.c @@ -0,0 +1,16 @@ +/* PR tree-optimization/60844 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g" } */ +/* { dg-additional-options "-mtune=atom" { target { i?86-*-* x86_64-*-* } } } */ + +void +foo (int *x, int y, int z) +{ + int b, c = x[0], d = x[1]; + for (b = 0; b < 1; b++) + { + int e = (y ? 1 : 0) | (d ? 2 : 0) | (z ? 1 : 0); + e |= (c ? 2 : 0) | ((1 >> b) ? 1 : 0); + x[2 + b] = e; + } +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr60866.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr60866.c new file mode 100644 index 000000000..020878d41 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr60866.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */ +/* { dg-options "-O -fselective-scheduling -fno-if-conversion -fschedule-insns" } */ + +int n; + +void +foo (int w, int **dnroot, int **dn) +{ + int *child; + int *xchild = xchild; + for (; w < n; w++) + if (!dnroot) + { + dnroot = dn; + for (child = *dn; child; child = xchild) + ; + } +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr61045.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr61045.c new file mode 100644 index 000000000..1808cdc25 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr61045.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-fstrict-overflow" } */ + +int main () +{ + int a = 0; + int b = __INT_MAX__; + int t = (a - 2) > (b - 1); + if (t != 0) + __builtin_abort(); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr61053.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr61053.c new file mode 100644 index 000000000..4fd531974 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr61053.c @@ -0,0 +1,75 @@ +/* PR c/61053 */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-std=c11 -pedantic-errors" } */ + +_Alignas (char) char cc; +_Alignas (short int) char cs; +_Alignas (int) char ci; +_Alignas (long int) char cl; +_Alignas (long long int) char cll; +_Alignas (float) char cf; +_Alignas (double) char cd; +_Alignas (long double) char cld; + +_Alignas (char) short int sc; /* { dg-error "cannot reduce alignment" } */ +_Alignas (short int) short int ss; +_Alignas (int) short int si; +_Alignas (long int) short int sl; +_Alignas (long long int) short int sll; +_Alignas (float) short int sf; +_Alignas (double) short int sd; +_Alignas (long double) short int sld; + +_Alignas (char) int ic; /* { dg-error "cannot reduce alignment" } */ +_Alignas (short int) int is; /* { dg-error "cannot reduce alignment" } */ +_Alignas (int) int ii; +_Alignas (long int) int il; +_Alignas (long long int) int ill; +_Alignas (float) int if_; +_Alignas (double) int id; +_Alignas (long double) int ild; + +_Alignas (char) long int lic; /* { dg-error "cannot reduce alignment" } */ +_Alignas (short int) long int lis; /* { dg-error "cannot reduce alignment" } */ +_Alignas (int) long int lii; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (long int) long int lil; +_Alignas (long long int) long int lill; +_Alignas (float) long int lif; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (double) long int lid; +_Alignas (long double) long int lild; + +_Alignas (char) long long int llic; /* { dg-error "cannot reduce alignment" } */ +_Alignas (short int) long long int llis; /* { dg-error "cannot reduce alignment" } */ +_Alignas (int) long long int llii; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (long int) long long int llil; +_Alignas (long long int) long long int llill; +_Alignas (float) long long int llif; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (double) long long int llid; +_Alignas (long double) long long int llild; + +_Alignas (char) float fc; /* { dg-error "cannot reduce alignment" } */ +_Alignas (short int) float fs; /* { dg-error "cannot reduce alignment" } */ +_Alignas (int) float fi; +_Alignas (long int) float fl; +_Alignas (long long int) float fll; +_Alignas (float) float ff; +_Alignas (double) float fd; +_Alignas (long double) float fld; + +_Alignas (char) double dc; /* { dg-error "cannot reduce alignment" } */ +_Alignas (short int) double ds; /* { dg-error "cannot reduce alignment" } */ +_Alignas (int) double di; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (long int) double dl; +_Alignas (long long int) double dll; +_Alignas (float) double df; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (double) double dd; +_Alignas (long double) double dld; + +_Alignas (char) long double ldc; /* { dg-error "cannot reduce alignment" } */ +_Alignas (short int) long double lds; /* { dg-error "cannot reduce alignment" } */ +_Alignas (int) long double ldi; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (long int) long double ldl; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (long long int) long double ldll; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (float) long double ldf; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (double) long double ldd; /* { dg-error "cannot reduce alignment" "" { target { ! { ia32 } } } } */ +_Alignas (long double) long double ldld; diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr61060.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr61060.c new file mode 100644 index 000000000..d2a136507 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr61060.c @@ -0,0 +1,19 @@ +/* PR target/61060 */ +/* { dg-do compile } */ +/* { dg-options "-O0 -ftree-ter" } */ + +typedef __SIZE_TYPE__ size_t; + +extern inline __attribute__ ((gnu_inline, always_inline, artificial)) +void *memset (void *dest, int ch, size_t len) +{ + return __builtin_memset (dest, ch, len); +} + +char buf[10]; + +void +foo (void) +{ + memset (buf, sizeof (buf), 0); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr61158.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr61158.c new file mode 100644 index 000000000..d0ba7f387 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr61158.c @@ -0,0 +1,12 @@ +/* PR tree-optimization/61158 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-original" } */ + +unsigned long long +foo (unsigned int x) +{ + return ((unsigned long long) x & 0x00ff000000000000ULL) >> 40; +} + +/* { dg-final { scan-tree-dump "return 0;" "original" { target { ilp32 || lp64 } } } } */ +/* { dg-final { cleanup-tree-dump "original" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr61583.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr61583.c new file mode 100644 index 000000000..8424293c1 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr61583.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fcompare-debug" } */ + +void +f1 (int n, int b) +{ + extern void f2 (int); + int j; + + if (b) + n = 1; + + if (n < 1) + __builtin_unreachable (); + + for (j = 0; j < n; j++) + f2 (j); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/record-compilation-info-in-elf-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/record-compilation-info-in-elf-1.c new file mode 100644 index 000000000..881281fc7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/record-compilation-info-in-elf-1.c @@ -0,0 +1,16 @@ +/* { dg-do compile} */ +/* { dg-options "-frecord-compilation-info-in-elf -Dtest -dA" } */ + +void foobar(int); + +void +foo (void) +{ + int i; + for (i = 0; i < 100; i++) + { + foobar(i); + } +} + +/* { dg-final { scan-assembler-times "Dtest" 1 } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c new file mode 100644 index 000000000..2512db396 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-1.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-options "-fschedule-insns" { target scheduling } } */ + +extern void abort (void); + +struct S { + int i; + int j; +}; + +struct U { + struct S s; +} __attribute__((may_alias)); + +int __attribute__((noinline,noclone)) +foo (struct U *p, struct U *q) +{ + int i; + q->s.j = 1; + i = p->s.i; + return i; +} + +int main() +{ + int a[3]; + int *p = a; + p[1] = 0; + if (foo ((struct U *)(p + 1), (struct U *)p) != 1) + abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-2.c new file mode 100644 index 000000000..04f55914e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr56965-2.c @@ -0,0 +1,34 @@ +extern void abort (void); + +struct S { int i; int j; }; +struct X { struct S s; int k; }; +struct Y { int k; struct S s; }; +union U { struct X x; struct Y y; } __attribute__((may_alias)); + +int __attribute__((noinline)) +foo (union U *p, union U *q) +{ + p->x.s.j = 1; + q->y.s.i = 0; + return p->x.s.j; +} + +struct R { int i; int j; } __attribute__((may_alias)); + +int __attribute__((noinline)) +bar (struct R *p, struct R *q) +{ + p->i = 1; + q->j = 0; + return p->i; +} + +int main() +{ + int a[3]; + if (foo ((union U *)&a[0], (union U *)&a[0]) != 0) + abort (); + if (bar ((struct R *)&a[1], (struct R *)&a[0]) != 0) + abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c new file mode 100644 index 000000000..93962c20e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr57864.c @@ -0,0 +1,37 @@ +/* { dg-do compile } */ + +union U { + double val; + union U *ptr; +}; + +union U *d; +double a; +int b; +int c; + +static void fn1(union U *p1, int p2, _Bool p3) +{ + union U *e; + + if (p2 == 0) + a = ((union U*)((unsigned long)p1 & ~1))->val; + + if (b) { + e = p1; + } else if (c) { + e = ((union U*)((unsigned long)p1 & ~1))->ptr; + d = e; + } else { + e = 0; + d = ((union U*)0)->ptr; + } + + fn1 (e, 0, 0); + fn1 (0, 0, p3); +} + +void fn2 (void) +{ + fn1 (0, 0, 0); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60891.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60891.c new file mode 100644 index 000000000..c8fec87ea --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60891.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fno-tree-ch -fno-tree-cselim -fno-tree-dominator-opts" } */ + +int a, b, c, d, e, f; + +void foo (int x) +{ + for (;;) + { + int g = c; + if (x) + { + if (e) + while (a) + --f; + } + for (b = 5; b; b--) + { + } + if (!g) + x = 0; + } +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60903.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60903.c new file mode 100644 index 000000000..5d93ae3ee --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60903.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ + +extern int a, b, k, q; + +void +foo () +{ + if (a) + { + while (q) + { + lbl: + if (a) + { + a = 0; + goto lbl; + } + } + b = k; + } + goto lbl; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60930.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60930.c new file mode 100644 index 000000000..5e35f1988 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr60930.c @@ -0,0 +1,22 @@ +/* { dg-do run } */ + +int x = 1; + +__attribute__((noinline, noclone)) void +foo (unsigned long long t) +{ + asm volatile ("" : : "r" (&t)); + if (t == 1) + __builtin_abort (); +} + +int +main () +{ +#if __SIZEOF_LONG_LONG__ >= 8 + unsigned long long t = 0xffffffffffffffffULL * (0xffffffffUL * x); + if (t != 0xffffffff00000001ULL) + foo (t);; +#endif + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61010.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61010.c new file mode 100644 index 000000000..ed5653982 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61010.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ + +int main (void) +{ + int a = 0; + unsigned b = (a * 64 & 192) | 63U; + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61383-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61383-1.c new file mode 100644 index 000000000..d9a0a0b39 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61383-1.c @@ -0,0 +1,35 @@ +/* { dg-do run } */ + +int a, b = 1, c, d, e, f, g; + +int +fn1 () +{ + int h; + for (;;) + { + g = b; + g = g ? 0 : 1 % g; + e = a + 1; + for (; d < 1; d = e) + { + if (f == 0) + h = 0; + else + h = 1 % f; + if (f < 1) + c = 0; + else if (h) + break; + } + if (b) + return 0; + } +} + +int +main () +{ + fn1 (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61452.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61452.c new file mode 100644 index 000000000..a62de30fd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61452.c @@ -0,0 +1,31 @@ +/* { dg-do run } */ + +int a, b; +short c, d; +char e, f; + +int +fn1 (int p1, char p2) +{ + return p1 || p2 ? 0 : p2; +} + +void +fn2 () +{ + for (; a;) + { + int g; + g = c = e; + for (; a;) + b = fn1 (g = d = e, g); + f = g; + } +} + +int +main () +{ + fn2 (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61681.c b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61681.c new file mode 100644 index 000000000..226de0c1a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/torture/pr61681.c @@ -0,0 +1,37 @@ +/* { dg-do run } */ + +extern void abort (void); + +int a = 1, *e = &a, **f = &e, *l, *p, j; +static int b; +long d; +short g; + +void +fn1 (int *p) +{ + int m; + if (!(*p & j)) + { + int *n = &m; + for (d = 6; d; d--) + { + for (g = 0; g < 1; g++) + { + n = l = *f; + b = *p; + } + *n = 0; + } + } +} + +int +main () +{ + p = *f; + fn1 (p); + if (b != 0) + abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1a.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1a.c index a94195cd9..520cad0b2 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/crossmodule-indircall-1a.c @@ -1,6 +1,7 @@ /* It seems there is no way to avoid the other source of mulitple source testcase from being compiled independently. Just avoid error. */ +/* { dg-require-effective-target lto } */ #ifdef DOJOB extern int a; void abort (void); diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c index e44887b52..99398a60f 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/inliner-1.c @@ -1,4 +1,4 @@ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 --param inline-hot-caller=0 -fdump-tree-optimized" } */ int a; int b[100]; void abort (void); @@ -34,7 +34,7 @@ main () return 0; } -/* cold function should be inlined, while hot function should not. +/* cold function should be not inlined, while hot function should be. Look for "cold_function () [tail call];" call statement not for the declaration or other appearances of the string in dump. */ /* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/bb-reorg_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/bb-reorg_0.c new file mode 100644 index 000000000..f850c9bfd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/bb-reorg_0.c @@ -0,0 +1,39 @@ +/* { dg-require-effective-target freorder } */ +/* { dg-options "-O2 -freorder-blocks-and-partition" } */ + +#include + +#define SIZE 1000 +int t0 = 0; +const char *t2[SIZE]; +char buf[SIZE]; + +void +foo (void) +{ + char *s = buf; + t0 = 1; + + for (;;) + { + if (*s == '\0') + break; + else + { + t2[t0] = s; + t0++; + } + *s++ = '\0'; + } + t2[t0] = NULL; +} + + +int +main () +{ + strcpy (buf, "hello"); + foo (); + return 0; +} + diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/ic-misattribution-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/ic-misattribution-1_0.c new file mode 100644 index 000000000..ff103a8c5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/ic-misattribution-1_0.c @@ -0,0 +1,19 @@ +/* { dg-options "-O2 -fdump-ipa-profile" } */ + +extern void callee (void); +extern void caller (void (*func) (void)); + +typedef void (*func_t) (void); +func_t func; + +int +main () +{ + func = callee; + caller (callee); + func (); + return 0; +} + +/* { dg-final-use { scan-ipa-dump-times "Indirect call -> direct call" 2 "profile" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/ic-misattribution-1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/ic-misattribution-1_1.c new file mode 100644 index 000000000..4948ec4fa --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/ic-misattribution-1_1.c @@ -0,0 +1,18 @@ +/* { dg-options "-O2 -fdump-ipa-profile" } */ + +extern void other_caller (void); + +void +callee (void) +{ + return; +} + +void +caller(void (*func) (void)) +{ + func (); +} + +/* { dg-final-use { scan-ipa-dump "Indiret call -> direct call" "profile" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof-single_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof-single_0.c new file mode 100644 index 000000000..29a216c69 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof-single_0.c @@ -0,0 +1,43 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ + +static int a1 (void) +{ + return 10; +} + +static int a2 (void) +{ + return 0; +} + +typedef int (*tp) (void); + +static tp aa [] = {a2, a1, a1, a1, a1}; + +__attribute__((noinline)) void setp (int (**pp) (void), int i) +{ + if (!i) + *pp = aa [i]; + else + *pp = aa [(i & 2) + 1]; +} + +int +main (void) +{ + int (*p) (void); + int i; + + for (i = 0; i < 10; i ++) + { + setp (&p, i); + p (); + } + + return 0; +} + +/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* a1" "profile"} } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof_0.c new file mode 100644 index 000000000..6bd048df6 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof_0.c @@ -0,0 +1,23 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ + +extern void setp (int (**pp) (void), int i); + +int +main (void) +{ + int (*p) (void); + int i; + + for (i = 0; i < 10; i ++) + { + setp (&p, i); + p (); + } + + return 0; +} + +/* { dg-final-use { scan-ipa-dump "Indirect call -> direct call.* a1" "profile"} } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof_1.c new file mode 100644 index 000000000..0cdb607cd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/indir-call-prof_1.c @@ -0,0 +1,23 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ + +int a1 (void) +{ + return 10; +} + +int a2 (void) +{ + return 0; +} + +typedef int (*tp) (void); + +tp aa [] = {a2, a1, a1, a1, a1}; + +__attribute__((noinline)) void setp (int (**pp) (void), int i) +{ + if (!i) + *pp = aa [i]; + else + *pp = aa [(i & 2) + 1]; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c new file mode 100644 index 000000000..a82b95d82 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/inliner-1_0.c @@ -0,0 +1,42 @@ +/* { dg-options "-O2 --param inline-hot-caller=0 -fdump-tree-optimized" } */ +int a; +int b[100]; +void abort (void); + +inline void +cold_function () +{ + int i; + for (i = 0; i < 99; i++) + if (b[i] / (b[i+1] + 1)) + abort (); +} + +inline void +hot_function () +{ + int i; + for (i = 0; i < 99; i++) + if (b[i] / (b[i+1] + 1)) + abort (); +} + +main () +{ + int i; + for (i = 0; i < 100; i++) + { + if (a) + cold_function (); + else + hot_function (); + } + return 0; +} + +/* cold function should not be inlined, while hot function should be. + Look for "cold_function () [tail call];" call statement not for the + declaration or other apperances of the string in dump. */ +/* { dg-final-use { scan-tree-dump "cold_function ..;" "optimized"} } */ +/* { dg-final-use { scan-tree-dump-not "hot_function ..;" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo.exp b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo.exp new file mode 100644 index 000000000..26abc7f88 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo.exp @@ -0,0 +1,60 @@ +# Copyright (C) 2001, 2002, 2004, 2005, 2007, 2008 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Test the functionality of programs compiled with profile-directed block +# ordering using -fprofile-generate followed by -fbranch-use. + +load_lib target-supports.exp + +# Some targets don't support tree profiling. +if { ![check_profiling_available ""] } { + return +} + +# The procedures in profopt.exp need these parameters. +set tool gcc +set prof_ext [list {gcda} {gcda.imports} ] + +# Override the list defined in profopt.exp. +set PROFOPT_OPTIONS [list {}] + +if $tracelevel then { + strace $tracelevel +} + +# Load support procs. +load_lib profopt.exp + +# These are globals used by profopt-execute. The first is options +# needed to generate profile data, the second is options to use the +# profile data. +set profile_option "-fprofile-generate -fripa -D_PROFILE_GENERATE" +set feedback_option "-fprofile-use -fripa -D_PROFILE_USE" + +# Add -fno-section-anchors for powerpc. Workround for Google ref b/6663281 +if {[istarget powerpc*-*-*]} { + set profile_option "$profile_option -fno-section-anchors" + set feedback_option "$feedback_option -fno-section-anchors" +} + +foreach src [lsort [glob -nocomplain $srcdir/$subdir/*_0.c]] { + # If we're only testing specific files and this isn't one of them, skip it. + if ![runtest_file_p $runtests $src] then { + continue + } + profopt-execute $src +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_0.c new file mode 100644 index 000000000..d48080981 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_0.c @@ -0,0 +1,29 @@ +/* { dg-options "-O2 -fdump-tree-optimized-details-blocks -fdump-ipa-inline-details -fopt-info" } */ + +extern int foo (void); +extern int goo (void); + + +int bar (void) +{ + return 2; +} + +int g; +int main () +{ + int s = 0, i; + + for (i = 0; i < 1000; i ++) + { + s += foo(); /* Should be inlined */ + s += goo(); /* Should be inlined */ + } + + g = s; + return 0; +} + +/* { dg-final-use { scan-tree-dump-not "foo" "optimized"} } */ +/* { dg-final-use { scan-tree-dump-not "goo" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_1.c new file mode 100644 index 000000000..9725ca769 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_1.c @@ -0,0 +1,22 @@ +extern int bar(void); +extern int blah(void); +int foo (void) +{ + int i, s = 0; + + for (i = 0; i < 2; i++) + { + s += bar(); /* Inlined */ + s += blah(); /* Inlined */ + } + return s; +} + +int goo (void) +{ + return 10; +} + +/* { dg-final-use { scan-tree-dump-not "bar" "optimized"} } */ +/* { dg-final-use { scan-tree-dump-not "blah" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_2.c new file mode 100644 index 000000000..9eeadb20a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/lipo_inline1_2.c @@ -0,0 +1,6 @@ +int blah (void) +{ + return 2; +} + +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr34999_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr34999_0.c new file mode 100644 index 000000000..4ec42790e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr34999_0.c @@ -0,0 +1,45 @@ +/* Same test as built-in-setjmp.c. Includes the case where + the source block of a crossing fallthru edge ends with a call. */ +/* { dg-require-effective-target freorder } */ +/* { dg-options "-O2 -freorder-blocks-and-partition" } */ + +extern int strcmp(const char *, const char *); +extern char *strcpy(char *, const char *); +extern void abort(void); +extern void exit(int); + +void *buf[20]; + +void __attribute__((noinline)) +sub2 (void) +{ + __builtin_longjmp (buf, 1); +} + +int +main () +{ + char *p = (char *) __builtin_alloca (20); + + strcpy (p, "test"); + + if (__builtin_setjmp (buf)) + { + if (strcmp (p, "test") != 0) + abort (); + + exit (0); + } + + { + int *q = (int *) __builtin_alloca (p[2] * sizeof (int)); + int i; + + for (i = 0; i < p[2]; i++) + q[i] = 0; + + while (1) + sub2 (); + } +} + diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr45354_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr45354_0.c new file mode 100644 index 000000000..b30ad7769 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr45354_0.c @@ -0,0 +1,43 @@ +/* { dg-require-effective-target freorder } */ +/* { dg-options "-O -freorder-blocks-and-partition -fschedule-insns -fselective-scheduling" { target powerpc*-*-* ia64-*-* x86_64-*-* } } */ + +extern void abort (void); + +int ifelse_val2; + +int __attribute__((noinline)) +test_ifelse2 (int i) +{ + int result = 0; + if (!i) /* count(6) */ + result = 1; /* count(1) */ + if (i == 1) /* count(6) */ + result = 1024; + if (i == 2) /* count(6) */ + result = 2; /* count(3) */ + if (i == 3) /* count(6) */ + return 8; /* count(2) */ + if (i == 4) /* count(4) */ + return 2048; + return result; /* count(4) */ +} + +void __attribute__((noinline)) +call_ifelse () +{ + ifelse_val2 += test_ifelse2 (0); + ifelse_val2 += test_ifelse2 (2); + ifelse_val2 += test_ifelse2 (2); + ifelse_val2 += test_ifelse2 (2); + ifelse_val2 += test_ifelse2 (3); + ifelse_val2 += test_ifelse2 (3); +} + +int +main() +{ + call_ifelse (); + if (ifelse_val2 != 23) + abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr47187_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr47187_0.c new file mode 100644 index 000000000..467ce252b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/pr47187_0.c @@ -0,0 +1,23 @@ +/* PR bootstrap/47187 */ +/* { dg-options "-O2" } */ + +char buf[64]; +char buf2[64]; + +void * +foo (char *p, long size) +{ + return __builtin_memcpy (buf, p, size); +} + +int +main (void) +{ + long i; + for (i = 0; i < 65536; i++) + if (foo ("abcdefghijkl", 12) != buf) + __builtin_abort (); + if (foo (buf2, 64) != buf) + __builtin_abort (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/stringop-1_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/stringop-1_0.c new file mode 100644 index 000000000..f73061387 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/stringop-1_0.c @@ -0,0 +1,22 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ +int a[1000]; +int b[1000]; +int size=1; +int max=10000; +main() +{ + int i; + for (i=0;i" "optimized"} } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-4_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-4_0.c new file mode 100644 index 000000000..239bf595d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-4_0.c @@ -0,0 +1,32 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ +unsigned int a[1000]; +unsigned int b = 999; +unsigned int c = 1002; +unsigned int d = 1003; +main () +{ + int i; + unsigned int n; + for (i = 0; i < 1000; i++) + { + a[i]=1000+i; + } + for (i = 0; i < 1000; i++) + { + if (i % 2) + n = b; + else if (i % 3) + n = c; + else + n = d; + a[i] %= n; + } + return 0; +} +/* { dg-final-use { scan-ipa-dump "Mod subtract transformation on insn" "profile" } } */ +/* This is part of code checking that n is greater than the divisor so we are sure that it + didn't get optimized out. */ +/* { dg-final-use { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-5_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-5_0.c new file mode 100644 index 000000000..1a804a767 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-5_0.c @@ -0,0 +1,17 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile" } */ +int a[1000]; +int b=997; +main() +{ + int i; + for (i = 0; i < 1000; i++) + if (a[i]) + a[i]/=b; + else + a[i]/=b; + return 0; +} +/* { dg-final-use { scan-ipa-dump "Div.mod by constant b.*=997 transformation on insn" "profile" } } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-6_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-6_0.c new file mode 100644 index 000000000..c439fcffe --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-6_0.c @@ -0,0 +1,20 @@ +/* { dg-options "-O2 -fdump-tree-optimized" } */ +char a[1000]; +char b[1000]; +int size=1000; +__attribute__ ((noinline)) +t(int size) +{ + __builtin_memcpy(a,b,size); +} +int +main() +{ + int i; + for (i=0; i < size; i++) + t(i); + return 0; +} +/* { dg-final-use { scan-tree-dump "Average value sum:499500" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "IOR value" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-7_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-7_0.c new file mode 100644 index 000000000..5f5326384 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/val-prof-7_0.c @@ -0,0 +1,26 @@ +/* { dg-options "-O2 -fdump-ipa-profile -mtune=core2" } */ +/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */ + +#include + +int foo(int len) +{ + char array[1000]; + bzero(array, len); + return 0; +} + +int main() { + int i; + for (i = 0; i < 1000; i++) + { + if (i > 990) + foo(16); + else + foo(8); + } + return 0; +} + +/* { dg-final-use { scan-ipa-dump "Single value 8 stringop transformation on bzero" "profile" } } */ +/* { dg-final-use { cleanup-ipa-dump "profile" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/wcoverage-mismatch_0.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/wcoverage-mismatch_0.c new file mode 100644 index 000000000..e4231057f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/lipo/wcoverage-mismatch_0.c @@ -0,0 +1,20 @@ +/* { dg-options "-O2 -Wno-coverage-mismatch" } */ + +int __attribute__((noinline)) bar (void) +{ +} + +int foo (int i) +{ +#ifdef _PROFILE_USE + if (i) + bar (); +#endif + return 0; +} + +int main(int argc, char **argv) +{ + foo (argc); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/merge_block.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/merge_block.c new file mode 100644 index 000000000..91bd47482 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-prof/merge_block.c @@ -0,0 +1,21 @@ + +/* { dg-options "-O2 -fno-ipa-pure-const -fdump-tree-optimized-blocks -fno-early-inlining" } */ +int a[8]; +int t() +{ + int i; + for (i = 0; i < 3; i++) + if (a[i]) + break; + return i; +} +main () +{ + int i; + /* The loop will be optimized away after ipa-inline. */ + for (i = 0; i < 1000; i++) + t (); + return 0; +} +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ +/* { dg-final-use { cleanup-tree-dump "optimized" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_1.c index 74b73da68..c2f7ebd26 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_1.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_1.c @@ -1,5 +1,5 @@ /* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */ -/* { dg-options "-O2 -m64 -fdump-tree-ivopts" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -m64 -fdump-tree-ivopts" } */ #define TYPE char* /* Testing that only one induction variable is selected after IVOPT on diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_2.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_2.c index f27b90072..87334c61c 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_2.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_2.c @@ -1,5 +1,5 @@ /* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */ -/* { dg-options "-O2 -m64 -fdump-tree-ivopts" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -m64 -fdump-tree-ivopts" } */ #define TYPE char* diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_4.c index 330b3bf53..bd6393e58 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_4.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopt_4.c @@ -1,5 +1,5 @@ /* { dg-do compile { target {{ i?86-*-* x86_64-*-* } && lp64 } } } */ -/* { dg-options "-O2 -m64 -fdump-tree-ivopts" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -m64 -fdump-tree-ivopts" } */ #ifndef TYPE #define TYPE char* diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c index 5188fed2c..d1e03e365 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-ivopts" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -fdump-tree-ivopts" } */ /* { dg-require-effective-target stdint_types } */ #include "stdint.h" diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-16.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-16.c index 50fa33330..4b41ebe16 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-16.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/loop-16.c @@ -2,7 +2,7 @@ at most 100 times, thus the (32-bit) induction variables do not overflow, and we may use 64-bit variable to represent them. */ -/* { dg-options "-O2 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -fdump-tree-optimized" } */ /* { dg-do compile { target x86_64-*-* } } */ unsigned a[100]; diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c index f1e52e5d8..b4490d52e 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-do run } */ -/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */ void abort (void); diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c index c29a46ac2..3164c4569 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-4.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-do run } */ -/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */ /* Test for predictive commoning of expressions, without reassociation. */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c index 29444abe5..b830c4d65 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/predcom-5.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-do run } */ -/* { dg-options "-O2 -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -funroll-loops --param max-unroll-times=8 -fpredictive-commoning -fdump-tree-pcom-details" } */ /* Test for predictive commoning of expressions, with reassociation. */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c index 5c469ba00..3af204a57 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-7.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ /* { dg-require-effective-target sse2 } */ /* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */ -/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */ #define K 1000000 int a[K]; diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c index 705d35fe2..31dc31469 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-8.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ /* { dg-require-effective-target sse2 } */ /* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */ -/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */ #define K 1000000 int a[K]; diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c index f78bea3a4..afbb8a047 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c @@ -1,7 +1,7 @@ /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ /* { dg-require-effective-target sse2 } */ /* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */ -/* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */ #define K 1000000 int a[K], b[K]; diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp93.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp93.c new file mode 100644 index 000000000..d78c399c3 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp93.c @@ -0,0 +1,36 @@ +/* PR target/29776 */ +/* PR tree-optimization/61725 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-vrp1" } */ +/* { dg-final { scan-tree-dump-not "link_error" "vrp1"} } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ + +#define A(fn, arg, min, max) \ + if (__builtin_##fn (arg) < min || __builtin_##fn (arg) > max) \ + link_error (); +#define B(fn, min, max) \ + A (fn, a, min, max) A (fn##l, b, min, max) A (fn##ll, c, min, max) +#define C(fn, min, sub) \ + A (fn, a, min, ((int) sizeof (a) * __CHAR_BIT__ - sub)) \ + A (fn##l, b, min, ((int) sizeof (b) * __CHAR_BIT__ - sub)) \ + A (fn##ll, c, min, ((int) sizeof (c) * __CHAR_BIT__ - sub)) + +extern void link_error (void); + +unsigned int d; +unsigned long e; +unsigned long long f; + +void +foo (int a, long b, long long c) +{ + C (ffs, 0, 0) + a &= 63; b &= 63; c &= 63; + B (ffs, 0, 6) + a++; b++; c++; + B (ffs, 1, 7) + a -= 2; b -= 2; c -= 2; + C (ffs, 0, 0) + a -= 63; b -= 63; c -= 63; + C (ffs, 1, 0) +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/typeof-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/typeof-2.c new file mode 100644 index 000000000..e9169003a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/typeof-2.c @@ -0,0 +1,28 @@ +/* Test qualifier discard of typeof for atomic types. */ +/* { dg-do compile } */ +/* { dg-options "-std=c11" } */ + +extern int i; + +extern int * p; + +extern int _Atomic const ci; +extern __typeof (ci) i; + +extern int _Atomic volatile vi; +extern __typeof (vi) i; + +extern int * _Atomic restrict ri; +extern __typeof (ri) p; + +void f(void) +{ + __auto_type aci = ci; + int *paci = &aci; + + __auto_type avi = vi; + int *pavi = &avi; + + __auto_type ari = ri; + int **pari = &ari; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/unused-8b.c b/gcc-4.9/gcc/testsuite/gcc.dg/unused-8b.c new file mode 100644 index 000000000..5b4b89493 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/unused-8b.c @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-options "-Wall -Wno-unused -Wextra" } */ + +void foo(int x) { } diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/var-expand1.c b/gcc-4.9/gcc/testsuite/gcc.dg/var-expand1.c index a784ea1a0..b4580ea8a 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/var-expand1.c +++ b/gcc-4.9/gcc/testsuite/gcc.dg/var-expand1.c @@ -2,7 +2,7 @@ /* We don't (and don't want to) perform this optimisation on soft-float targets, where each addition is a library call. */ /* { dg-require-effective-target hard_float } */ -/* { dg-options "-O2 -funroll-loops --fast-math -fvariable-expansion-in-unroller -fdump-rtl-loop2_unroll" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -funroll-loops --fast-math -fvariable-expansion-in-unroller -fdump-rtl-loop2_unroll" } */ extern void abort (void); diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60841.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60841.c new file mode 100644 index 000000000..44b5d0191 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr60841.c @@ -0,0 +1,183 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-ffast-math" } */ + +/* This testcase shouldn't consume much memory or produce a 1GB vectorizer + dump file due to SLP tree explosion. */ + +struct S { int f1, f2, f3, f4; } a; +struct T { short f3, f2, f1, f4; }; +int b, c, d, e, f, g; +unsigned long z; + +void +foo (struct T *p, struct T *q, int x, int w) +{ + for (; x; x++) + { + struct S h; + int i; + struct T j; + struct T *r; + h = a; + g = 0; + r = p + 2 * (c + 4) + 1; + j = *r; + r = p; + f = r->f1 - 1; + b = +1.0 + f * f; + i = (r->f2 + j.f2) / 2; + f = r->f3 - 1; + b += 1.0 - i * f * f; + f = r->f4 - 1; + if (b) + b += -1.0 - i * f; + if (b / w) + { + h.f1 += 8.0 * r->f1; + h.f2 += 8.0 * r->f2; + h.f3 += 8.0 * r->f3; + h.f4 += 8.0 * r->f4; + g = 1; + } + r++; + f = r->f1; + i = (r->f2 + j.f2) / 2; + f = r->f3 - 1; + b += 1.0 - i * f * f; + i = (r->f4); + if (b * 65535UL / w) + { + h.f1 += 10.0 * r->f1; + h.f2 += 10.0 * r->f2; + h.f3 += 10.0 * r->f3; + h.f4 += 10.0 * r->f4; + g += 10.0; + } + r++; + f = r->f1; + z = 5UL * i; + f = r->f2; + i = (r->f3 + j.f3) / 2; + b = -i * f * f; + i = (r->f4 + j.f4) / 2; + if (b * 65535UL / 25.0f) + { + h.f1 += 8.0 * r->f1; + h.f2 += 8.0 * r->f2; + h.f3 += 8.0 * r->f3; + h.f4 += 8.0 * r->f4; + g += 8.0; + } + r++; + f = r->f1 - j.f1; + b = 1 * 2.0 * i * f * f; + f = r->f2; + b += 4.0 * f; + i = r->f3 / 2; + f = r->f4 - 1; + if (b * 1) + { + h.f1 += 8.0 * r->f1; + h.f2 += 8.0 * r->f2; + h.f3 += 8.0 * r->f3; + h.f4 += 8.0 * r->f4; + g += 8.0; + } + b = 4.0 * 1 * f; + if (b * 65535UL / 25.0f) + { + h.f1 += 20.0 * r->f1; + h.f2 += 20.0 * r->f2; + h.f3 += 20.0 * r->f3; + h.f4 += 20.0 * r->f4; + g += 20.0; + } + b = 5 * (0.0 - i); + if (b < 0) + { + h.f1 += 8.0 * r->f1; + h.f2 += 8.0 * r->f2; + h.f3 += 8.0 * r->f3; + h.f4 += 8.0 * r->f4; + g += 8.0; + } + r = p + 2 * (c + 4); + i = (r->f1 + j.f1); + b = 1 * 2.0 * i * 1; + f = r->f2 - 1; + i = (r->f3 + j.f3) / 2; + b = 5 * (0.0 - i) * f * f; + i = (r->f4 + j.f4) / 2; + if (b * 65535UL / 25.0f) + { + h.f1 += 10.0 * r->f1; + h.f2 += 10.0 * r->f2; + h.f3 += 10.0 * r->f3; + h.f4 += 10.0 * r->f4; + g += 10.0; + } + r++; + f = r->f1; + b = 5UL * i * f; + i = (r->f2 + j.f2) / 2; + f = r->f3 - 1; + b = 5 * (0.0 - i) * f * f; + f = r->f4 - 1; + if (b * 65535UL / 25.0f) + { + h.f1 += 40.0 * r->f1; + h.f2 += 40.0 * r->f2; + h.f3 += 40.0 * r->f3; + h.f4 += 40.0 * r->f4; + g += 40.0; + } + r++; + i = (r->f1 + j.f1); + b = 5 * i * f; + f = r->f2; + b = 4.0 * f * f; + f = r->f3; + i = (r->f4 + j.f4) / 2; + b = 5 * (0.0 - i) * f * f; + if (b * 25.0f) + { + h.f1 += 8.0 * r->f1; + h.f2 += 8.0 * r->f2; + h.f3 += 8.0 * r->f3; + h.f4 += 8.0 * r->f4; + g += 8.0; + } + r = p + 4 * (c + 4); + i = r->f1 / 2; + b = 5 * (1.0 + i); + i = r->f2 + j.f2; + f = r->f3 - 1; + b = 5 * (0.0 - i) * f * f; + i = (r->f4 + j.f4) / 2; + if (b * 65535UL / 25.0f) + { + h.f1 += 5.0 * r->f1; + h.f2 += 5.0 * r->f2; + h.f3 += 5.0 * r->f3; + h.f4 += 5.0 * r->f4; + g += 5.0; + } + b = 5 * (1.0 + i); + if (b < 0) + { + h.f1 += 5.0 * r->f1; + h.f2 += 5.0 * r->f2; + h.f3 += 5.0 * r->f3; + h.f4 += 5.0 * r->f4; + g += 5.0; + } + q->f1 = (h.f1 + g / 2 - 1) / g; + q->f2 = (h.f2 + g / 2 - 1) / g; + q->f3 = (h.f3 + g / 2 - 1) / g; + q->f4 = (h.f4 + g / 2 - 1) / g; + p++; + q++; + } +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr61680.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr61680.c new file mode 100644 index 000000000..605a651aa --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/pr61680.c @@ -0,0 +1,51 @@ +/* { dg-do run } */ + +#include "tree-vect.h" + +double v[4096][4]; + +__attribute__((noinline, noclone)) void +bar (double p[][4]) +{ + int i; + double d = 172.0; + for (i = 0; i < 4096; i++) + { + if (p[i][0] != 6.0 || p[i][1] != 6.0 || p[i][2] != 10.0) + __builtin_abort (); + if (__builtin_fabs (p[i][3] - d) > 0.25) + __builtin_abort (); + } +} + +__attribute__((noinline, noclone)) void +foo (void) +{ + int i; + double w[4096][4], t; + for (i = 0; i < 4096; i++) + { + w[i][0] = v[i][0] + 2.0; + w[i][1] = v[i][1] + 1.0; + w[i][2] = v[i][2] + 4.0; + w[i][3] = (w[i][0] * w[i][0] + w[i][1] * w[i][1] + w[i][2] * w[i][2]); + } + bar (w); +} + +int +main () +{ + int i; + + check_vect (); + + for (i = 0; i < 4096; i++) + { + v[i][0] = 4.0; + v[i][1] = 5.0; + v[i][2] = 6.0; + } + foo (); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-sad.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-sad.c new file mode 100644 index 000000000..15a625f6a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-reduc-sad.c @@ -0,0 +1,54 @@ +/* { dg-require-effective-target vect_usad_char } */ + +#include +#include "tree-vect.h" + +#define N 64 +#define SAD N*N/2 + +unsigned char X[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); +unsigned char Y[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))); + +/* Sum of absolute differences between arrays of unsigned char types. + Detected as a sad pattern. + Vectorized on targets that support sad for unsigned chars. */ + +__attribute__ ((noinline)) int +foo (int len) +{ + int i; + int result = 0; + + for (i = 0; i < len; i++) + result += abs (X[i] - Y[i]); + + return result; +} + + +int +main (void) +{ + int i; + int sad; + + check_vect (); + + for (i = 0; i < N; i++) + { + X[i] = i; + Y[i] = N - i; + __asm__ volatile (""); + } + + sad = foo (N); + if (sad != SAD) + abort (); + + return 0; +} + +/* { dg-final { scan-tree-dump-times "vect_recog_sad_pattern: detected" 1 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ +/* { dg-final { cleanup-tree-dump "vect" } } */ + diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-singleton_1.c b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-singleton_1.c new file mode 100644 index 000000000..6c2ff49cd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect-singleton_1.c @@ -0,0 +1,38 @@ +/* PR target/59843 ICE on function taking/returning vector of one float64_t. */ + +/* { dg-do compile } */ +/* { dg-options "-Warray-bounds -O2 -fno-inline -std=c99" } */ + +#define TEST(BASETYPE, VECTYPE, SUFFIX) \ + typedef BASETYPE VECTYPE \ + __attribute__ ((__vector_size__ (sizeof (BASETYPE)))); \ + VECTYPE \ + test_vadd_##SUFFIX (VECTYPE a, VECTYPE b) \ + { \ + return a + b; \ + } \ + \ + void \ + test_##SUFFIX (BASETYPE val) \ + { \ + VECTYPE var = { val }; \ + BASETYPE v0 = var[0]; \ + BASETYPE v1 = var[1]; /* { dg-warning "index value is out of bound" } */ \ + } + +TEST (double, float64x1_t, f64) + +/* Original bug was for above type; + in a nod to completeness, test other types too. */ + +TEST (long long, int64x1_t, s64) + +TEST (float, float32x1_t, f32) + +TEST (long, longx1_t, l) + +TEST (int, intx1_t, i) + +TEST (short, int16x1_t, s16) + +TEST (char, int8x1_t, s8) diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect.exp b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect.exp index fa11e7e5e..e8d866b99 100644 --- a/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect.exp +++ b/gcc-4.9/gcc/testsuite/gcc.dg/vect/vect.exp @@ -18,6 +18,7 @@ # Load support procs. load_lib gcc-dg.exp +load_lib clearcap.exp # Set up flags used for tests that don't specify options. global DEFAULT_VECTCFLAGS @@ -41,30 +42,9 @@ if ![check_vect_support_and_set_flags] { # These flags are used for all targets. lappend DEFAULT_VECTCFLAGS "-ftree-vectorize" "-fno-vect-cost-model" "-fno-common" -# If the linker used understands -M , pass it to clear hardware -# capabilities set by the Sun assembler. -# Try mapfile syntax v2 first which is the only way to clear hwcap_2 flags. -set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcapv2.map" - -if ![check_no_compiler_messages mapfilev2 executable { - int main (void) { return 0; } -} $clearcap_ldflags ] { - # If this doesn't work, fall back to the less capable v1 syntax. - set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map" - - if ![check_no_compiler_messages mapfile executable { - int main (void) { return 0; } - } $clearcap_ldflags ] { - unset clearcap_ldflags - } -} - -if [info exists clearcap_ldflags] { - lappend DEFAULT_VECTCFLAGS $clearcap_ldflags -} - # Initialize `dg'. dg-init +clearcap-init global VEC_FLAGS set VEC_FLAGS $DEFAULT_VECTCFLAGS @@ -308,4 +288,5 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-sra-bb-slp-*.\[cS\]] set dg-do-what-default ${save-dg-do-what-default} # All done. +clearcap-finish dg-finish diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-1.c new file mode 100644 index 000000000..19324a645 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-1.c @@ -0,0 +1,27 @@ +/* Test the self-assignemnt detection and warning. */ +/* { dg-do compile } */ +/* { dg-options "-Wself-assign" } */ + +struct Bar { + int b_; + int c_; +}; + +int g; + +int main() +{ + struct Bar *bar; + int x = x; /* { dg-warning "assigned to itself" } */ + static int y; + struct Bar b_array[5]; + + b_array[x+g].b_ = b_array[x+g].b_; /* { dg-warning "assigned to itself" } */ + g = g; /* { dg-warning "assigned to itself" } */ + y = y; /* { dg-warning "assigned to itself" } */ + bar->b_ = bar->b_; /* { dg-warning "assigned to itself" } */ + x += 0; /* should not warn */ + y -= 0; /* should not warn */ + x /= x; /* should not warn */ + y *= y; /* should not warn */ +} diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-2.c new file mode 100644 index 000000000..d0f69cbaf --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/wself-assign-2.c @@ -0,0 +1,24 @@ +/* Test how self-assignment detection handles constant-folding happening */ +/* when parsing the RHS or the initializer. */ +/* { dg-do compile } */ +/* { dg-options "-Wself-assign" } */ + +struct Bar { + int b_; + float c_; +}; + +int g; + +int main() +{ + struct Bar *bar; + int x = x - 0; /* should not warn */ + static int y; + struct Bar b_array[5]; + + b_array[x+g].b_ = b_array[x+g].b_ * 1; /* should no warn */ + g = g + 0; /* should not warn */ + y = y / 1; /* should not warn */ + bar->b_ = bar->b_ - 0; /* should not warn */ +} diff --git a/gcc-4.9/gcc/testsuite/gcc.misc-tests/help.exp b/gcc-4.9/gcc/testsuite/gcc.misc-tests/help.exp index e18912cfb..74f7eeb4a 100644 --- a/gcc-4.9/gcc/testsuite/gcc.misc-tests/help.exp +++ b/gcc-4.9/gcc/testsuite/gcc.misc-tests/help.exp @@ -55,7 +55,7 @@ check_for_options c "--help=target,optimizers" "" "" "" check_for_options c "--help=warnings,^joined,^undocumented" "" "" "" check_for_options c "-Q -O2 --help=optimizers" { -O --ftree-loop-vectorize[^\n]*disabled +-ftree-loop-vectorize[^\n]*enabled } " -g " "" check_for_options c "-Q -O3 --help=optimizers" { -O diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h index a95d06aa2..07e56fff8 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/type-def.h @@ -34,6 +34,13 @@ struct hfa_fx2_t float b; }; +struct hfa_fx3_t +{ + float a; + float b; + float c; +}; + struct hfa_dx2_t { double a; diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c new file mode 100644 index 000000000..ae1e3ec45 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-13.c @@ -0,0 +1,59 @@ +/* Test AAPCS64 layout and __builtin_va_start. + + Pass named HFA/HVA argument on stack. */ + +/* { dg-do run { target aarch64*-*-* } } */ + +#ifndef IN_FRAMEWORK +#define AAPCS64_TEST_STDARG +#define TESTFILE "va_arg-13.c" + +struct float_float_t +{ + float a; + float b; +} float_float; + +union float_int_t +{ + float b8; + int b5; +} float_int; + +#define HAS_DATA_INIT_FUNC +void +init_data () +{ + float_float.a = 1.2f; + float_float.b = 2.2f; + + float_int.b8 = 4983.80f; +} + +#include "abitest.h" +#else + ARG (float, 1.0f, S0, 0) + ARG (float, 2.0f, S1, 1) + ARG (float, 3.0f, S2, 2) + ARG (float, 4.0f, S3, 3) + ARG (float, 5.0f, S4, 4) + ARG (float, 6.0f, S5, 5) + ARG (float, 7.0f, S6, 6) + ARG (struct float_float_t, float_float, STACK, 7) + ARG (int, 9, W0, 8) + ARG (int, 10, W1, 9) + ARG (int, 11, W2, 10) + ARG (int, 12, W3, 11) + ARG (int, 13, W4, 12) + ARG (int, 14, W5, 13) + ARG (int, 15, W6, LAST_NAMED_ARG_ID) + DOTS + /* Note on the reason of using 'X7' instead of 'W7' here: + Using 'X7' makes sure the test works in the big-endian mode. + According to PCS rules B.4 and C.10, the size of float_int is rounded + to 8 bytes and prepared in the register X7 as if loaded via LDR from + the memory, with the content of the other 4 bytes unspecified. The + test framework will only compare the 4 relavent bytes. */ + ANON (union float_int_t, float_int, X7, 15) + LAST_ANON (long long, 12683143434LL, STACK + 8, 16) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c new file mode 100644 index 000000000..91080d5af --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-14.c @@ -0,0 +1,35 @@ +/* Test AAPCS64 layout and __builtin_va_start. + + Pass named HFA/HVA argument on stack. */ + +/* { dg-do run { target aarch64*-*-* } } */ + +#ifndef IN_FRAMEWORK +#define AAPCS64_TEST_STDARG +#define TESTFILE "va_arg-14.c" +#include "type-def.h" + +struct hfa_fx2_t hfa_fx2 = {1.2f, 2.2f}; +struct hfa_fx3_t hfa_fx3 = {3.2f, 4.2f, 5.2f}; +vf4_t float32x4 = {6.2f, 7.2f, 8.2f, 9.2f}; +vf4_t float32x4_2 = {10.2f, 11.2f, 12.2f, 13.2f}; + +#include "abitest.h" +#else + ARG (float, 1.0f, S0, 0) + ARG (float, 2.0f, S1, 1) + ARG (float, 3.0f, S2, 2) + ARG (float, 4.0f, S3, 3) + ARG (float, 5.0f, S4, 4) + ARG (float, 6.0f, S5, 5) + ARG (float, 7.0f, S6, 6) + ARG (struct hfa_fx3_t, hfa_fx3, STACK, 7) + /* Previous argument size has been rounded up to the nearest multiple of + 8 bytes. */ + ARG (struct hfa_fx2_t, hfa_fx2, STACK + 16, 8) + /* NSAA is rounded up to the nearest natural alignment of float32x4. */ + ARG (vf4_t, float32x4, STACK + 32, 9) + ARG (vf4_t, float32x4_2, STACK + 48, LAST_NAMED_ARG_ID) + DOTS + LAST_ANON (double, 123456789.987, STACK + 64, 11) +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c new file mode 100644 index 000000000..d8fdb322b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-15.c @@ -0,0 +1,39 @@ +/* Test AAPCS64 layout and __builtin_va_start. + + Pass named __128int argument on stack. */ + +/* { dg-do run { target aarch64*-*-* } } */ + +#ifndef IN_FRAMEWORK +#define AAPCS64_TEST_STDARG +#define TESTFILE "va_arg-15.c" +#include "type-def.h" + +union int128_t qword; + +#define HAS_DATA_INIT_FUNC +void +init_data () +{ + /* Init signed quad-word integer. */ + qword.l64 = 0xfdb9753102468aceLL; + qword.h64 = 0xeca8642013579bdfLL; +} + +#include "abitest.h" +#else + ARG (int, 1, W0, 0) + ARG (int, 2, W1, 1) + ARG (int, 3, W2, 2) + ARG (int, 4, W3, 3) + ARG (int, 5, W4, 4) + ARG (int, 6, W5, 5) + ARG (int, 7, W6, 6) + ARG (__int128, qword.i, STACK, LAST_NAMED_ARG_ID) + DOTS +#ifndef __AAPCS64_BIG_ENDIAN__ + LAST_ANON (int, 8, STACK + 16, 8) +#else + LAST_ANON (int, 8, STACK + 20, 8) +#endif +#endif diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/pr61325.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/pr61325.c new file mode 100644 index 000000000..45ece5344 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/pr61325.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +typedef unsigned int wchar_t; +typedef long unsigned int size_t; + +size_t +wcstombs(char *s , const wchar_t *pwcs , size_t n) +{ + int count = 0; + + if (n != 0) { + do { + if ((*s++ = (char) *pwcs++) == 0) + break; + count++; + } while (--n != 0); + } + return count; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/scalar_intrinsics.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/scalar_intrinsics.c index aa041cc2c..782f6d194 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/scalar_intrinsics.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/scalar_intrinsics.c @@ -387,7 +387,7 @@ test_vqdmlalh_s16 (int32x1_t a, int16x1_t b, int16x1_t c) /* { dg-final { scan-assembler-times "\\tsqdmlal\\ts\[0-9\]+, h\[0-9\]+, v" 1 } } */ int32x1_t -test_vqdmlalh_lane_s16 (int32x1_t a, int16x1_t b, int16x8_t c) +test_vqdmlalh_lane_s16 (int32x1_t a, int16x1_t b, int16x4_t c) { return vqdmlalh_lane_s16 (a, b, c, 3); } @@ -403,7 +403,7 @@ test_vqdmlals_s32 (int64x1_t a, int32x1_t b, int32x1_t c) /* { dg-final { scan-assembler-times "\\tsqdmlal\\td\[0-9\]+, s\[0-9\]+, v" 1 } } */ int64x1_t -test_vqdmlals_lane_s32 (int64x1_t a, int32x1_t b, int32x4_t c) +test_vqdmlals_lane_s32 (int64x1_t a, int32x1_t b, int32x2_t c) { return vqdmlals_lane_s32 (a, b, c, 1); } @@ -419,7 +419,7 @@ test_vqdmlslh_s16 (int32x1_t a, int16x1_t b, int16x1_t c) /* { dg-final { scan-assembler-times "\\tsqdmlsl\\ts\[0-9\]+, h\[0-9\]+, v" 1 } } */ int32x1_t -test_vqdmlslh_lane_s16 (int32x1_t a, int16x1_t b, int16x8_t c) +test_vqdmlslh_lane_s16 (int32x1_t a, int16x1_t b, int16x4_t c) { return vqdmlslh_lane_s16 (a, b, c, 3); } @@ -435,7 +435,7 @@ test_vqdmlsls_s32 (int64x1_t a, int32x1_t b, int32x1_t c) /* { dg-final { scan-assembler-times "\\tsqdmlsl\\td\[0-9\]+, s\[0-9\]+, v" 1 } } */ int64x1_t -test_vqdmlsls_lane_s32 (int64x1_t a, int32x1_t b, int32x4_t c) +test_vqdmlsls_lane_s32 (int64x1_t a, int32x1_t b, int32x2_t c) { return vqdmlsls_lane_s32 (a, b, c, 1); } @@ -451,7 +451,7 @@ test_vqdmulhh_s16 (int16x1_t a, int16x1_t b) /* { dg-final { scan-assembler-times "\\tsqdmulh\\th\[0-9\]+, h\[0-9\]+, v" 1 } } */ int16x1_t -test_vqdmulhh_lane_s16 (int16x1_t a, int16x8_t b) +test_vqdmulhh_lane_s16 (int16x1_t a, int16x4_t b) { return vqdmulhh_lane_s16 (a, b, 3); } @@ -467,9 +467,9 @@ test_vqdmulhs_s32 (int32x1_t a, int32x1_t b) /* { dg-final { scan-assembler-times "\\tsqdmulh\\ts\[0-9\]+, s\[0-9\]+, v" 1 } } */ int32x1_t -test_vqdmulhs_lane_s32 (int32x1_t a, int32x4_t b) +test_vqdmulhs_lane_s32 (int32x1_t a, int32x2_t b) { - return vqdmulhs_lane_s32 (a, b, 3); + return vqdmulhs_lane_s32 (a, b, 1); } /* { dg-final { scan-assembler-times "\\tsqdmull\\ts\[0-9\]+, h\[0-9\]+, h\[0-9\]+" 1 } } */ @@ -483,7 +483,7 @@ test_vqdmullh_s16 (int16x1_t a, int16x1_t b) /* { dg-final { scan-assembler-times "\\tsqdmull\\ts\[0-9\]+, h\[0-9\]+, v" 1 } } */ int32x1_t -test_vqdmullh_lane_s16 (int16x1_t a, int16x8_t b) +test_vqdmullh_lane_s16 (int16x1_t a, int16x4_t b) { return vqdmullh_lane_s16 (a, b, 3); } @@ -499,7 +499,7 @@ test_vqdmulls_s32 (int32x1_t a, int32x1_t b) /* { dg-final { scan-assembler-times "\\tsqdmull\\td\[0-9\]+, s\[0-9\]+, v" 1 } } */ int64x1_t -test_vqdmulls_lane_s32 (int32x1_t a, int32x4_t b) +test_vqdmulls_lane_s32 (int32x1_t a, int32x2_t b) { return vqdmulls_lane_s32 (a, b, 1); } @@ -515,9 +515,9 @@ test_vqrdmulhh_s16 (int16x1_t a, int16x1_t b) /* { dg-final { scan-assembler-times "\\tsqrdmulh\\th\[0-9\]+, h\[0-9\]+, v" 1 } } */ int16x1_t -test_vqrdmulhh_lane_s16 (int16x1_t a, int16x8_t b) +test_vqrdmulhh_lane_s16 (int16x1_t a, int16x4_t b) { - return vqrdmulhh_lane_s16 (a, b, 6); + return vqrdmulhh_lane_s16 (a, b, 3); } /* { dg-final { scan-assembler-times "\\tsqrdmulh\\ts\[0-9\]+, s\[0-9\]+, s\[0-9\]+" 1 } } */ @@ -531,9 +531,9 @@ test_vqrdmulhs_s32 (int32x1_t a, int32x1_t b) /* { dg-final { scan-assembler-times "\\tsqrdmulh\\ts\[0-9\]+, s\[0-9\]+, v" 1 } } */ int32x1_t -test_vqrdmulhs_lane_s32 (int32x1_t a, int32x4_t b) +test_vqrdmulhs_lane_s32 (int32x1_t a, int32x2_t b) { - return vqrdmulhs_lane_s32 (a, b, 2); + return vqrdmulhs_lane_s32 (a, b, 1); } /* { dg-final { scan-assembler-times "\\tsuqadd\\tb\[0-9\]+" 1 } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vector_intrinsics.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vector_intrinsics.c index affb8a8a1..52b0496c8 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vector_intrinsics.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vector_intrinsics.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O2" } */ -#include "../../../config/aarch64/arm_neon.h" +#include "arm_neon.h" /* { dg-final { scan-assembler-times "\\tfmax\\tv\[0-9\]+\.2s, v\[0-9\].2s, v\[0-9\].2s" 1 } } */ @@ -305,7 +305,7 @@ test_vqdmlal_high_s16 (int32x4_t __a, int16x8_t __b, int16x8_t __c) /* { dg-final { scan-assembler-times "\\tsqdmlal2\\tv\[0-9\]+\.4s, v\[0-9\]+\.8h, v\[0-9\]+\.h" 3 } } */ int32x4_t -test_vqdmlal_high_lane_s16 (int32x4_t a, int16x8_t b, int16x8_t c) +test_vqdmlal_high_lane_s16 (int32x4_t a, int16x8_t b, int16x4_t c) { return vqdmlal_high_lane_s16 (a, b, c, 3); } @@ -361,7 +361,7 @@ test_vqdmlal_high_s32 (int64x2_t __a, int32x4_t __b, int32x4_t __c) /* { dg-final { scan-assembler-times "\\tsqdmlal2\\tv\[0-9\]+\.2d, v\[0-9\]+\.4s, v\[0-9\]+\.s" 3 } } */ int64x2_t -test_vqdmlal_high_lane_s32 (int64x2_t __a, int32x4_t __b, int32x4_t __c) +test_vqdmlal_high_lane_s32 (int64x2_t __a, int32x4_t __b, int32x2_t __c) { return vqdmlal_high_lane_s32 (__a, __b, __c, 1); } @@ -417,7 +417,7 @@ test_vqdmlsl_high_s16 (int32x4_t __a, int16x8_t __b, int16x8_t __c) /* { dg-final { scan-assembler-times "\\tsqdmlsl2\\tv\[0-9\]+\.4s, v\[0-9\]+\.8h, v\[0-9\]+\.h" 3 } } */ int32x4_t -test_vqdmlsl_high_lane_s16 (int32x4_t a, int16x8_t b, int16x8_t c) +test_vqdmlsl_high_lane_s16 (int32x4_t a, int16x8_t b, int16x4_t c) { return vqdmlsl_high_lane_s16 (a, b, c, 3); } @@ -473,7 +473,7 @@ test_vqdmlsl_high_s32 (int64x2_t __a, int32x4_t __b, int32x4_t __c) /* { dg-final { scan-assembler-times "\\tsqdmlsl2\\tv\[0-9\]+\.2d, v\[0-9\]+\.4s, v\[0-9\]+\.s" 3 } } */ int64x2_t -test_vqdmlsl_high_lane_s32 (int64x2_t __a, int32x4_t __b, int32x4_t __c) +test_vqdmlsl_high_lane_s32 (int64x2_t __a, int32x4_t __b, int32x2_t __c) { return vqdmlsl_high_lane_s32 (__a, __b, __c, 1); } @@ -529,7 +529,7 @@ test_vqdmull_high_s16 (int16x8_t __a, int16x8_t __b) /* { dg-final { scan-assembler-times "\\tsqdmull2\\tv\[0-9\]+\.4s, v\[0-9\]+\.8h, v\[0-9\]+\.h" 3 } } */ int32x4_t -test_vqdmull_high_lane_s16 (int16x8_t a, int16x8_t b) +test_vqdmull_high_lane_s16 (int16x8_t a, int16x4_t b) { return vqdmull_high_lane_s16 (a, b, 3); } @@ -585,7 +585,7 @@ test_vqdmull_high_s32 (int32x4_t __a, int32x4_t __b) /* { dg-final { scan-assembler-times "\\tsqdmull2\\tv\[0-9\]+\.2d, v\[0-9\]+\.4s, v\[0-9\]+\.s" 3 } } */ int64x2_t -test_vqdmull_high_lane_s32 (int32x4_t __a, int32x4_t __b) +test_vqdmull_high_lane_s32 (int32x4_t __a, int32x2_t __b) { return vqdmull_high_lane_s32 (__a, __b, 1); } diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_lane_s16.c new file mode 100644 index 000000000..1388c3b61 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_lane_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmlal_high_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmlal_high_lane_s16 (int32x4_t a, int16x8_t b, int16x4_t c) +{ + return vqdmlal_high_lane_s16 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal2\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_lane_s32.c new file mode 100644 index 000000000..f90387dba --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_lane_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlal_high_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmlal_high_lane_s32 (int64x2_t a, int32x4_t b, int32x2_t c) +{ + return vqdmlal_high_lane_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal2\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_laneq_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_laneq_s16.c new file mode 100644 index 000000000..5399ce985 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_laneq_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmlal_high_laneq_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmlal_high_laneq_s16 (int32x4_t a, int16x8_t b, int16x8_t c) +{ + return vqdmlal_high_laneq_s16 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal2\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_laneq_s32.c new file mode 100644 index 000000000..e4b55582e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_high_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlal_high_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmlal_high_laneq_s32 (int64x2_t a, int32x4_t b, int32x4_t c) +{ + return vqdmlal_high_laneq_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal2\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_lane_s16.c new file mode 100644 index 000000000..7e60c8220 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_lane_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmlal_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmlal_lane_s16 (int32x4_t a, int16x4_t b, int16x4_t c) +{ + return vqdmlal_lane_s16 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_lane_s32.c new file mode 100644 index 000000000..c0f508dc9 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_lane_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlal_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmlal_lane_s32 (int64x2_t a, int32x2_t b, int32x2_t c) +{ + return vqdmlal_lane_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_laneq_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_laneq_s16.c new file mode 100644 index 000000000..9bf130435 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_laneq_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmlal_laneq_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmlal_laneq_s16 (int32x4_t a, int16x4_t b, int16x8_t c) +{ + return vqdmlal_laneq_s16 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_laneq_s32.c new file mode 100644 index 000000000..5fd9c56dc --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlal_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlal_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmlal_laneq_s32 (int64x2_t a, int32x2_t b, int32x4_t c) +{ + return vqdmlal_laneq_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlalh_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlalh_lane_s16.c new file mode 100644 index 000000000..83f5af596 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlalh_lane_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmlalh_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x1_t +t_vqdmlalh_lane_s16 (int32x1_t a, int16x1_t b, int16x4_t c) +{ + return vqdmlalh_lane_s16 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal\[ \t\]+\[sS\]\[0-9\]+, ?\[hH\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlals_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlals_lane_s32.c new file mode 100644 index 000000000..ef94e95d9 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlals_lane_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlals_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x1_t +t_vqdmlals_lane_s32 (int64x1_t a, int32x1_t b, int32x2_t c) +{ + return vqdmlals_lane_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlal\[ \t\]+\[dD\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_lane_s16.c new file mode 100644 index 000000000..276a1a2a9 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_lane_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmlsl_high_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmlsl_high_lane_s16 (int32x4_t a, int16x8_t b, int16x4_t c) +{ + return vqdmlsl_high_lane_s16 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlsl2\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_lane_s32.c new file mode 100644 index 000000000..2ae58ef0b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_lane_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlsl_high_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmlsl_high_lane_s32 (int64x2_t a, int32x4_t b, int32x2_t c) +{ + return vqdmlsl_high_lane_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlsl2\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_laneq_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_laneq_s16.c new file mode 100644 index 000000000..1db5db4c9 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_laneq_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmlsl_high_laneq_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmlsl_high_laneq_s16 (int32x4_t a, int16x8_t b, int16x8_t c) +{ + return vqdmlsl_high_laneq_s16 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlsl2\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_laneq_s32.c new file mode 100644 index 000000000..3a72a7bca --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_high_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlsl_high_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmlsl_high_laneq_s32 (int64x2_t a, int32x4_t b, int32x4_t c) +{ + return vqdmlsl_high_laneq_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlsl2\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_lane_s16.c new file mode 100644 index 000000000..0535378e4 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_lane_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmlsl_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmlsl_lane_s16 (int32x4_t a, int16x4_t b, int16x4_t c) +{ + return vqdmlsl_lane_s16 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlsl\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_lane_s32.c new file mode 100644 index 000000000..b52e51e1a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_lane_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlsl_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmlsl_lane_s32 (int64x2_t a, int32x2_t b, int32x2_t c) +{ + return vqdmlsl_lane_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlsl\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_laneq_s32.c new file mode 100644 index 000000000..7009a35f2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsl_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlsl_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmlsl_lane_s32 (int64x2_t a, int32x2_t b, int32x4_t c) +{ + return vqdmlsl_laneq_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlsl\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlslh_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlslh_lane_s16.c new file mode 100644 index 000000000..056dfbb11 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlslh_lane_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmlslh_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x1_t +t_vqdmlslh_lane_s16 (int32x1_t a, int16x1_t b, int16x4_t c) +{ + return vqdmlslh_lane_s16 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlsl\[ \t\]+\[sS\]\[0-9\]+, ?\[hH\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsls_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsls_lane_s32.c new file mode 100644 index 000000000..9e351bc36 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmlsls_lane_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmlsls_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x1_t +t_vqdmlsls_lane_s32 (int64x1_t a, int32x1_t b, int32x2_t c) +{ + return vqdmlsls_lane_s32 (a, b, c, 0); +} + +/* { dg-final { scan-assembler-times "sqdmlsl\[ \t\]+\[dD\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulh_laneq_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulh_laneq_s16.c new file mode 100644 index 000000000..d3c699bd3 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulh_laneq_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmulh_laneq_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int16x4_t +t_vqdmulh_laneq_s16 (int16x4_t a, int16x8_t b) +{ + return vqdmulh_laneq_s16 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmulh\[ \t\]+\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulh_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulh_laneq_s32.c new file mode 100644 index 000000000..c6202ce19 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulh_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmulh_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x2_t +t_vqdmulh_laneq_s32 (int32x2_t a, int32x4_t b) +{ + return vqdmulh_laneq_s32 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmulh\[ \t\]+\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhh_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhh_lane_s16.c new file mode 100644 index 000000000..763585100 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhh_lane_s16.c @@ -0,0 +1,36 @@ +/* Test the vqdmulhh_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do run } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" +#include + +extern void abort (void); + +int +main (void) +{ + int16_t arg1; + int16x4_t arg2; + int16_t result; + int16_t actual; + int16_t expected; + + arg1 = -32768; + arg2 = vcreate_s16 (0x0000ffff2489e398ULL); + actual = vqdmulhh_lane_s16 (arg1, arg2, 2); + expected = 1; + + if (expected != actual) + { + fprintf (stderr, "Expected: %xd, got %xd\n", expected, actual); + abort (); + } + + return 0; +} + + +/* { dg-final { scan-assembler-times "sqdmulh\[ \t\]+\[hH\]\[0-9\]+, ?\[hH\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[hH\]\\\[2\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhq_laneq_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhq_laneq_s16.c new file mode 100644 index 000000000..809c85a77 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhq_laneq_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmulhq_laneq_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int16x8_t +t_vqdmulhq_laneq_s16 (int16x8_t a, int16x8_t b) +{ + return vqdmulhq_laneq_s16 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmulh\[ \t\]+\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhq_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhq_laneq_s32.c new file mode 100644 index 000000000..d375fe818 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhq_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmulhq_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmulhq_laneq_s32 (int32x4_t a, int32x4_t b) +{ + return vqdmulhq_laneq_s32 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmulh\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhs_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhs_lane_s32.c new file mode 100644 index 000000000..9c27f5f3a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulhs_lane_s32.c @@ -0,0 +1,34 @@ +/* Test the vqdmulhs_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do run } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" +#include + +extern void abort (void); + +int +main (void) +{ + int32_t arg1; + int32x2_t arg2; + int32_t result; + int32_t actual; + int32_t expected; + + arg1 = 57336; + arg2 = vcreate_s32 (0x55897fff7fff0000ULL); + actual = vqdmulhs_lane_s32 (arg1, arg2, 0); + expected = 57334; + + if (expected != actual) + { + fprintf (stderr, "Expected: %xd, got %xd\n", expected, actual); + abort (); + } + + return 0; +} +/* { dg-final { scan-assembler-times "sqdmulh\[ \t\]+\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_lane_s16.c new file mode 100644 index 000000000..0af320e2c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_lane_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmull_high_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmull_high_lane_s16 (int16x8_t a, int16x4_t b) +{ + return vqdmull_high_lane_s16 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull2\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_lane_s32.c new file mode 100644 index 000000000..583e8a172 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_lane_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmull_high_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmull_high_lane_s32 (int32x4_t a, int32x2_t b) +{ + return vqdmull_high_lane_s32 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull2\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_laneq_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_laneq_s16.c new file mode 100644 index 000000000..dcfd14c71 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_laneq_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmull_high_laneq_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmull_high_laneq_s16 (int16x8_t a, int16x8_t b) +{ + return vqdmull_high_laneq_s16 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull2\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_laneq_s32.c new file mode 100644 index 000000000..3e8b652d9 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_high_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmull_high_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmull_high_laneq_s32 (int32x4_t a, int32x4_t b) +{ + return vqdmull_high_laneq_s32 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull2\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_lane_s16.c new file mode 100644 index 000000000..695d4e3fb --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_lane_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmull_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmull_lane_s16 (int16x4_t a, int16x4_t b) +{ + return vqdmull_lane_s16 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_lane_s32.c new file mode 100644 index 000000000..e6a02b573 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_lane_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmull_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmull_lane_s32 (int32x2_t a, int32x2_t b) +{ + return vqdmull_lane_s32 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_laneq_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_laneq_s16.c new file mode 100644 index 000000000..ba761b231 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_laneq_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmull_laneq_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqdmull_laneq_s16 (int16x4_t a, int16x8_t b) +{ + return vqdmull_laneq_s16 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_laneq_s32.c new file mode 100644 index 000000000..82b8e19ed --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmull_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmull_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x2_t +t_vqdmull_laneq_s32 (int32x2_t a, int32x4_t b) +{ + return vqdmull_laneq_s32 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull\[ \t\]+\[vV\]\[0-9\]+\.2\[dD\], ?\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmullh_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmullh_lane_s16.c new file mode 100644 index 000000000..fd271e0b3 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmullh_lane_s16.c @@ -0,0 +1,15 @@ +/* Test the vqdmullh_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x1_t +t_vqdmullh_lane_s16 (int16x1_t a, int16x4_t b) +{ + return vqdmullh_lane_s16 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull\[ \t\]+\[sS\]\[0-9\]+, ?\[hH\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulls_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulls_lane_s32.c new file mode 100644 index 000000000..110333375 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqdmulls_lane_s32.c @@ -0,0 +1,15 @@ +/* Test the vqdmulls_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int64x1_t +t_vqdmulls_lane_s32 (int32x1_t a, int32x2_t b) +{ + return vqdmulls_lane_s32 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqdmull\[ \t\]+\[dD\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulh_laneq_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulh_laneq_s16.c new file mode 100644 index 000000000..0313f1c07 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulh_laneq_s16.c @@ -0,0 +1,15 @@ +/* Test the vqrdmulh_laneq_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int16x4_t +t_vqrdmulh_laneq_s16 (int16x4_t a, int16x8_t b) +{ + return vqrdmulh_laneq_s16 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqrdmulh\[ \t\]+\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.4\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulh_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulh_laneq_s32.c new file mode 100644 index 000000000..a9124ee10 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulh_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqrdmulh_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x2_t +t_vqrdmulh_laneq_s32 (int32x2_t a, int32x4_t b) +{ + return vqrdmulh_laneq_s32 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqrdmulh\[ \t\]+\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.2\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhh_lane_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhh_lane_s16.c new file mode 100644 index 000000000..f21863ab4 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhh_lane_s16.c @@ -0,0 +1,35 @@ +/* Test the vqrdmulhh_lane_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do run } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" +#include + +extern void abort (void); + +int +main (void) +{ + int16_t arg1; + int16x4_t arg2; + int16_t result; + int16_t actual; + int16_t expected; + + arg1 = -32768; + arg2 = vcreate_s16 (0xd78e000005d78000ULL); + actual = vqrdmulhh_lane_s16 (arg1, arg2, 3); + expected = 10354; + + if (expected != actual) + { + fprintf (stderr, "Expected: %xd, got %xd\n", expected, actual); + abort (); + } + + return 0; +} + +/* { dg-final { scan-assembler-times "sqrdmulh\[ \t\]+\[hH\]\[0-9\]+, ?\[hH\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[hH\]\\\[3\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhq_laneq_s16.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhq_laneq_s16.c new file mode 100644 index 000000000..488e694ab --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhq_laneq_s16.c @@ -0,0 +1,15 @@ +/* Test the vqrdmulhq_laneq_s16 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int16x8_t +t_vqrdmulhq_laneq_s16 (int16x8_t a, int16x8_t b) +{ + return vqrdmulhq_laneq_s16 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqrdmulh\[ \t\]+\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.8\[hH\], ?\[vV\]\[0-9\]+\.\[hH\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhq_laneq_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhq_laneq_s32.c new file mode 100644 index 000000000..42519f615 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhq_laneq_s32.c @@ -0,0 +1,15 @@ +/* Test the vqrdmulhq_laneq_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do compile } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" + +int32x4_t +t_vqrdmulhq_laneq_s32 (int32x4_t a, int32x4_t b) +{ + return vqrdmulhq_laneq_s32 (a, b, 0); +} + +/* { dg-final { scan-assembler-times "sqrdmulh\[ \t\]+\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.4\[sS\], ?\[vV\]\[0-9\]+\.\[sS\]\\\[0\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhs_lane_s32.c b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhs_lane_s32.c new file mode 100644 index 000000000..83d2ba28e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/aarch64/vqrdmulhs_lane_s32.c @@ -0,0 +1,35 @@ +/* Test the vqrdmulhs_lane_s32 AArch64 SIMD intrinsic. */ + +/* { dg-do run } */ +/* { dg-options "-save-temps -O3 -fno-inline" } */ + +#include "arm_neon.h" +#include + +extern void abort (void); + +int +main (void) +{ + int32_t arg1; + int32x2_t arg2; + int32_t result; + int32_t actual; + int32_t expected; + + arg1 = -2099281921; + arg2 = vcreate_s32 (0x000080007fff0000ULL); + actual = vqrdmulhs_lane_s32 (arg1, arg2, 1); + expected = -32033; + + if (expected != actual) + { + fprintf (stderr, "Expected: %xd, got %xd\n", expected, actual); + abort (); + } + + return 0; +} + +/* { dg-final { scan-assembler-times "sqrdmulh\[ \t\]+\[sS\]\[0-9\]+, ?\[sS\]\[0-9\]+, ?\[vV\]\[0-9\]+\.\[sS\]\\\[1\\\]\n" 1 } } */ +/* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/alpha/pr61586.c b/gcc-4.9/gcc/testsuite/gcc.target/alpha/pr61586.c new file mode 100644 index 000000000..afb1af359 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/alpha/pr61586.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mieee" } */ + +void foo (int *dimensions, double **params, int hh) +{ + if (params[hh]) + ; + else if (dimensions[hh] > 0) + params[hh][0] = 1.0f; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr48252.c b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr48252.c index 17f729bb3..250d5e4d6 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/arm/pr48252.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/arm/pr48252.c @@ -15,7 +15,6 @@ int main(void) uint8x8x2_t vd1, vd2; union {uint8x8_t v; uint8_t buf[8];} d1, d2, d3, d4; int i; - uint8_t odd, even; vd1 = vzip_u8(v1, vdup_n_u8(0)); vd2 = vzip_u8(v2, vdup_n_u8(0)); @@ -25,17 +24,9 @@ int main(void) vst1_u8(d3.buf, vd2.val[0]); vst1_u8(d4.buf, vd2.val[1]); -#ifdef __ARMEL__ - odd = 1; - even = 0; -#else - odd = 0; - even = 1; -#endif - for (i = 0; i < 8; i++) - if ((i % 2 == even && d4.buf[i] != 2) - || (i % 2 == odd && d4.buf[i] != 0)) + if ((i % 2 == 0 && d4.buf[i] != 2) + || (i % 2 == 1 && d4.buf[i] != 0)) abort (); return 0; diff --git a/gcc-4.9/gcc/testsuite/gcc.target/avr/pr60991.c b/gcc-4.9/gcc/testsuite/gcc.target/avr/pr60991.c new file mode 100644 index 000000000..a09f42a62 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/avr/pr60991.c @@ -0,0 +1,21 @@ +/* { dg-do run } */ +/* { dg-options "-O1" } */ + +/* This testcase (simplified from the original bug report) exposes + PR60991. The code generated for writing the __int24 value corrupts + the frame pointer if the offset is <= 63 + MAX_LD_OFFSET */ + +#include + +int main(void) +{ + volatile char junk[62]; + junk[0] = 5; + volatile __int24 staticConfig = 0; + + if (junk[0] != 5) + abort(); + + exit(0); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/avr/torture/pr61055.c b/gcc-4.9/gcc/testsuite/gcc.target/avr/torture/pr61055.c new file mode 100644 index 000000000..9dd1f427d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/avr/torture/pr61055.c @@ -0,0 +1,88 @@ +/* { dg-do run } */ +/* { dg-options { -fno-peephole2 } } */ + +#include + +typedef __UINT16_TYPE__ uint16_t; +typedef __INT16_TYPE__ int16_t; +typedef __UINT8_TYPE__ uint8_t; + +uint8_t __attribute__((noinline,noclone)) +fun_inc (uint8_t c0) +{ + register uint8_t c asm ("r15") = c0; + + /* Force target value into R15 (lower register) */ + asm ("" : "+l" (c)); + + c++; + if (c >= 0x80) + c = 0; + + asm ("" : "+l" (c)); + + return c; +} + +uint8_t __attribute__((noinline,noclone)) +fun_dec (uint8_t c0) +{ + register uint8_t c asm ("r15") = c0; + + /* Force target value into R15 (lower register) */ + asm ("" : "+l" (c)); + + c--; + if (c < 0x80) + c = 0; + + asm ("" : "+l" (c)); + + return c; +} + + +uint8_t __attribute__((noinline,noclone)) +fun_neg (uint8_t c0) +{ + register uint8_t c asm ("r15") = c0; + + c = -c; + if (c >= 0x80) + c = 0; + + return c; +} + +uint16_t __attribute__((noinline,noclone)) +fun_adiw (uint16_t c0) +{ + register uint16_t c asm ("r24") = c0; + + /* Force target value into R24 (for ADIW) */ + asm ("" : "+r" (c)); + + c += 2; + if (c >= 0x8000) + c = 0; + + asm ("" : "+r" (c)); + + return c; +} + + +int main() +{ + if (fun_inc (0x7f) != 0) + abort(); + + if (fun_neg (0x80) != 0) + abort(); + + if (fun_adiw (0x7ffe) != 0) + abort(); + + exit (0); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/avr/torture/pr61443.c b/gcc-4.9/gcc/testsuite/gcc.target/avr/torture/pr61443.c new file mode 100644 index 000000000..12c6bca66 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/avr/torture/pr61443.c @@ -0,0 +1,134 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99" } */ + +#include +#include + +#define NC __attribute__((noinline,noclone)) + +void NC vfun (char n, ...) +{ + va_list ap; + + va_start (ap, n); + + switch (n) + { + default: + abort(); + case 1: + if (11 != va_arg (ap, int)) + abort(); + break; + case 2: + if (2222 != va_arg (ap, int)) + abort(); + break; + case 3: + if (333333 != va_arg (ap, __int24)) + abort(); + break; + case 4: + if (44444444 != va_arg (ap, long)) + abort(); + break; + case 8: + if (8888888888888888 != va_arg (ap, long long)) + abort(); + break; + } + + va_end (ap); +} + + +void NC boo_qi (const __flash char *p) +{ + vfun (1, *p); +} + +void NC boox_qi (const __memx char *p) +{ + vfun (1, *p); +} + +void NC boo_hi (const __flash int *p) +{ + vfun (2, *p); +} + +void NC boox_hi (const __memx int *p) +{ + vfun (2, *p); +} + +void NC boo_psi (const __flash __int24 *p) +{ + vfun (3, *p); +} + +void NC boox_psi (const __memx __int24 *p) +{ + vfun (3, *p); +} + +void NC boo_si (const __flash long *p) +{ + vfun (4, *p); +} + +void NC boox_si (const __memx long *p) +{ + vfun (4, *p); +} + +void NC boo_di (const __flash long long *p) +{ + vfun (8, *p); +} + +void NC boox_di (const __memx long long *p) +{ + vfun (8, *p); +} + +const __flash char f_qi = 11; +const __flash int f_hi = 2222; +const __flash __int24 f_psi = 333333; +const __flash long f_si = 44444444; +const __flash long long f_di = 8888888888888888; + +const __memx char x_qi = 11; +const __memx int x_hi = 2222; +const __memx __int24 x_psi = 333333; +const __memx long x_si = 44444444; +const __memx long long x_di = 8888888888888888; + +char r_qi = 11; +int r_hi = 2222; +__int24 r_psi = 333333; +long r_si = 44444444; +long long r_di = 8888888888888888; + +int main (void) +{ + boo_qi (&f_qi); + boo_hi (&f_hi); + boo_psi (&f_psi); + boo_si (&f_si); + boo_di (&f_di); + + boox_qi (&x_qi); + boox_hi (&x_hi); + boox_psi (&x_psi); + boox_si (&x_si); + boox_di (&x_di); + + boox_qi (&r_qi); + boox_hi (&r_hi); + boox_psi (&r_psi); + boox_si (&r_si); + boox_di (&r_di); + + exit (0); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx-pr57233.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx-pr57233.c new file mode 100644 index 000000000..ffc71d908 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx-pr57233.c @@ -0,0 +1,16 @@ +/* PR tree-optimization/57233 */ +/* { dg-do run { target avx } } */ +/* { dg-options "-O2 -mavx" } */ + +#include "avx-check.h" + +static void +avx_test (void) +{ + do_main (); +} + +#undef main +#define main() do_main () + +#include "../../gcc.dg/pr57233.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-pr57233.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-pr57233.c new file mode 100644 index 000000000..3fb2608ab --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-pr57233.c @@ -0,0 +1,16 @@ +/* PR tree-optimization/57233 */ +/* { dg-do run { target avx2 } } */ +/* { dg-options "-O2 -mavx2" } */ + +#include "avx2-check.h" + +static void +avx2_test (void) +{ + do_main (); +} + +#undef main +#define main() do_main () + +#include "../../gcc.dg/pr57233.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c index ee1f31356..4b249c3fb 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpaddb-3.c @@ -8,5 +8,5 @@ #include "avx2-vpop-check.h" -/* { dg-final { scan-assembler-times "vpaddb\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler "vpaddb\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */ /* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpaddw-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpaddw-3.c index 7e7e018c1..889bd9f37 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpaddw-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpaddw-3.c @@ -8,5 +8,5 @@ #include "avx2-vpop-check.h" -/* { dg-final { scan-assembler-times "vpaddw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler "vpaddw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */ /* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpmullw-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpmullw-3.c index 4d61d7a9f..c54084301 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpmullw-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpmullw-3.c @@ -8,5 +8,5 @@ #include "avx2-vpop-check.h" -/* { dg-final { scan-assembler-times "vpmullw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler "vpmullw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */ /* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsraw-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsraw-3.c index 70bd5cd6b..e360fde0f 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsraw-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsraw-3.c @@ -8,5 +8,5 @@ #include "avx2-vpop-check.h" -/* { dg-final { scan-assembler-times "vpsraw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler "vpsraw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */ /* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsrlw-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsrlw-3.c index 691e02f3f..761ad8a24 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsrlw-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsrlw-3.c @@ -8,5 +8,5 @@ #include "avx2-vpop-check.h" -/* { dg-final { scan-assembler-times "vpsrlw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler "vpsrlw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */ /* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsubb-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsubb-3.c index 45527f524..c4eeff9d5 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsubb-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsubb-3.c @@ -8,5 +8,5 @@ #include "avx2-vpop-check.h" -/* { dg-final { scan-assembler-times "vpsubb\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler "vpsubb\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */ /* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsubw-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsubw-3.c index 404c2eea9..dc0d937d6 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsubw-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx2-vpsubw-3.c @@ -8,5 +8,5 @@ #include "avx2-vpop-check.h" -/* { dg-final { scan-assembler-times "vpsubw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 1 } } */ +/* { dg-final { scan-assembler "vpsubw\[ \\t\]+\[^\n\]*%ymm\[0-9\]" } } */ /* { dg-final { cleanup-saved-temps } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-pr57233.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-pr57233.c new file mode 100644 index 000000000..2f1c23a15 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/avx512f-pr57233.c @@ -0,0 +1,16 @@ +/* PR tree-optimization/57233 */ +/* { dg-do run { target avx512f } } */ +/* { dg-options "-O2 -mavx512f" } */ + +#include "avx512f-check.h" + +static void +avx512f_test (void) +{ + do_main (); +} + +#undef main +#define main() do_main () + +#include "../../gcc.dg/pr57233.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-andn-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-andn-1a.c index a7ee07653..6a0fe15c8 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-andn-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-andn-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mbmi -fno-inline -dp" } */ +/* { dg-options "-O2 -mbmi -fno-inline -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi-andn-1.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-andn-2a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-andn-2a.c index 72fe02639..c7a895cdc 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-andn-2a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-andn-2a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mbmi -fno-inline -dp" } */ +/* { dg-options "-O2 -mbmi -fno-inline -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi-andn-2.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-bextr-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-bextr-1a.c index 4ccfbdc98..8dbf1eb72 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-bextr-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-bextr-1a.c @@ -3,4 +3,4 @@ #include "bmi-bextr-1.c" -/* { dg-final { scan-assembler-times "bmi_bextr_di" 1 } } */ +/* { dg-final { scan-assembler "bmi_bextr_di" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-bextr-2a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-bextr-2a.c index 282a3e400..da476106d 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-bextr-2a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-bextr-2a.c @@ -3,4 +3,4 @@ #include "bmi-bextr-2.c" -/* { dg-final { scan-assembler-times "bmi_bextr_si" 1 } } */ +/* { dg-final { scan-assembler "bmi_bextr_si" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsi-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsi-1a.c index e9e0ecb67..ab5257143 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsi-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsi-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mbmi -fno-inline -dp" } */ +/* { dg-options "-O2 -mbmi -fno-inline -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi-blsi-1.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsi-2a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsi-2a.c index be9ca3f63..ccca576f6 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsi-2a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsi-2a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mbmi -fno-inline -dp" } */ +/* { dg-options "-O2 -mbmi -fno-inline -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi-blsi-2.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsmsk-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsmsk-1a.c index 4e6cb7b36..c75f33c48 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsmsk-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsmsk-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mbmi -fno-inline -dp" } */ +/* { dg-options "-O2 -mbmi -fno-inline -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi-blsmsk-1.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsmsk-2a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsmsk-2a.c index f6f6babff..7d3597d39 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsmsk-2a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsmsk-2a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mbmi -fno-inline -dp" } */ +/* { dg-options "-O2 -mbmi -fno-inline -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi-blsmsk-2.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsr-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsr-1a.c index 79241ca8f..736997dd8 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsr-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsr-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mbmi -fno-inline -dp" } */ +/* { dg-options "-O2 -mbmi -fno-inline -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi-blsr-1.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsr-2a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsr-2a.c index d88c16e4d..6f6b67fd6 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsr-2a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-blsr-2a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mbmi -fno-inline -dp" } */ +/* { dg-options "-O2 -mbmi -fno-inline -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi-blsr-2.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-tzcnt-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-tzcnt-1a.c index e283c3154..cd469a791 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-tzcnt-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-tzcnt-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O2 -mbmi -fno-inline" } */ +/* { dg-options "-O2 -mbmi -fno-inline --param max-default-completely-peeled-insns=0" } */ #include "bmi-tzcnt-1.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-tzcnt-2a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-tzcnt-2a.c index 2cdb3f443..b60a5a15b 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-tzcnt-2a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi-tzcnt-2a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mbmi -fno-inline" } */ +/* { dg-options "-O2 -mbmi -fno-inline --param max-default-completely-peeled-insns=0" } */ #include "bmi-tzcnt-2.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-bzhi32-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-bzhi32-1a.c index 05be7a837..64be3bafa 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-bzhi32-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-bzhi32-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mbmi2 -O2 -dp" } */ +/* { dg-options "-mbmi2 -O2 -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi2-bzhi32-1.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-bzhi64-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-bzhi64-1a.c index dc4a94cc3..08fee200e 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-bzhi64-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-bzhi64-1a.c @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-mbmi2 -O2 -dp" } */ +/* { dg-options "-mbmi2 -O2 -dp --param max-default-completely-peeled-insns=0" } */ #include "bmi2-bzhi64-1.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pdep32-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pdep32-1a.c index 87888fcff..7e528985e 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pdep32-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pdep32-1a.c @@ -3,4 +3,4 @@ #include "bmi2-pdep32-1.c" -/* { dg-final { scan-assembler-times "bmi2_pdep_si3" 1 } } */ +/* { dg-final { scan-assembler "bmi2_pdep_si3" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pdep64-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pdep64-1a.c index 8163c4062..24238ca21 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pdep64-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pdep64-1a.c @@ -3,4 +3,4 @@ #include "bmi2-pdep64-1.c" -/* { dg-final { scan-assembler-times "bmi2_pdep_di3" 1 } } */ +/* { dg-final { scan-assembler "bmi2_pdep_di3" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pext32-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pext32-1a.c index c4a6deeca..5d908b37d 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pext32-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pext32-1a.c @@ -3,4 +3,4 @@ #include "bmi2-pext32-1.c" -/* { dg-final { scan-assembler-times "bmi2_pext_si3" 1 } } */ +/* { dg-final { scan-assembler "bmi2_pext_si3" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pext64-1a.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pext64-1a.c index aaf06c1f2..c4fb99c85 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pext64-1a.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/bmi2-pext64-1a.c @@ -3,4 +3,4 @@ #include "bmi2-pext64-1.c" -/* { dg-final { scan-assembler-times "bmi2_pext_di3" 1 } } */ +/* { dg-final { scan-assembler "bmi2_pext_di3" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/cadd.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/cadd.c index 7a39c67ed..32036e1a5 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/cadd.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/cadd.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=k8" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -march=k8" } */ /* { dg-final { scan-assembler "sbb" } } */ extern void abort (void); diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/clearcap.map b/gcc-4.9/gcc/testsuite/gcc.target/i386/clearcap.map deleted file mode 100644 index 147f922d1..000000000 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/clearcap.map +++ /dev/null @@ -1,3 +0,0 @@ -# clear all hardware capabilities emitted by Sun as: the tests here -# guard against execution at runtime -hwcap_1 = V0x0 OVERRIDE; diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/clearcapv2.map b/gcc-4.9/gcc/testsuite/gcc.target/i386/clearcapv2.map deleted file mode 100644 index 95cb14cc5..000000000 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/clearcapv2.map +++ /dev/null @@ -1,7 +0,0 @@ -# clear all hardware capabilities emitted by Sun as: the tests here -# guard against execution at runtime -# uses mapfile v2 syntax which is the only way to clear AT_SUN_CAP_HW2 flags -$mapfile_version 2 -CAPABILITY { - HW = ; -}; diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/i386.exp b/gcc-4.9/gcc/testsuite/gcc.target/i386/i386.exp index 080e302b7..d9b36cd30 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/i386.exp +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/i386.exp @@ -23,6 +23,7 @@ if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then { # Load support procs. load_lib gcc-dg.exp +load_lib clearcap.exp # Return 1 if attribute ms_hook_prologue is supported. proc check_effective_target_ms_hook_prologue { } { @@ -307,39 +308,6 @@ proc check_effective_target_sha { } { } "-O2 -msha" ] } -# If the linker used understands -M , pass it to clear hardware -# capabilities set by the Sun assembler. -# Try mapfile syntax v2 first which is the only way to clear hwcap_2 flags. -set clearcap_ldflags "-Wl,-M,$srcdir/$subdir/clearcapv2.map" - -if ![check_no_compiler_messages mapfilev2 executable { - int main (void) { return 0; } -} $clearcap_ldflags ] { - # If this doesn't work, fall back to the less capable v1 syntax. - set clearcap_ldflags "-Wl,-M,$srcdir/$subdir/clearcap.map" - - if ![check_no_compiler_messages mapfile executable { - int main (void) { return 0; } - } $clearcap_ldflags ] { - unset clearcap_ldflags - } -} - -if [info exists clearcap_ldflags] { - if { [info procs gcc_target_compile] != [list] \ - && [info procs saved_gcc_target_compile] == [list] } { - rename gcc_target_compile saved_gcc_target_compile - - proc gcc_target_compile { source dest type options } { - global clearcap_ldflags - # Always pass -Wl,-M,, but don't let it show up in gcc.sum. - lappend options "additional_flags=$clearcap_ldflags" - - return [saved_gcc_target_compile $source $dest $type $options] - } - } -} - # If a testcase doesn't have special options, use these. global DEFAULT_CFLAGS if ![info exists DEFAULT_CFLAGS] then { @@ -348,6 +316,7 @@ if ![info exists DEFAULT_CFLAGS] then { # Initialize `dg'. dg-init +clearcap-init # Special case compilation of vect-args.c so we don't have to # replicate it 10 times. @@ -367,4 +336,5 @@ set tests [prune $tests $srcdir/$subdir/vect-args.c] dg-runtest $tests "" $DEFAULT_CFLAGS # All done. +clearcap-finish dg-finish diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-1.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-1.c new file mode 100644 index 000000000..aa1f424c8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-1.c @@ -0,0 +1,23 @@ +/* Verify -mpatch-functions-for-instrumentation works. */ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-mpatch-functions-for-instrumentation" } */ + +/* Check nop-bytes at beginning. */ +/* { dg-final { scan-assembler ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ +/* Check nop-bytes at end. */ +/* { dg-final { scan-assembler "ret(.*).byte\t0x90(.*).byte\t0x90" } } */ + +__attribute__ ((noinline)) +void foo() +{ + /* Dummy loop. */ + int x = 0; + while (++x); +} + +int main() +{ + foo(); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-2.c new file mode 100644 index 000000000..78de86763 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-2.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-mpatch-functions-for-instrumentation -mno-patch-functions-main-always" } */ + +/* Function is small to be instrumented with default values. Check there + aren't any nop-bytes at beginning or end of function. */ + +/* { dg-final { scan-assembler-not ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ +/* { dg-final { scan-assembler-not "ret(.*).byte\t0x90(.*).byte\t0x90" } } */ + +__attribute__ ((noinline)) +void foo() +{ + int x = 0; +} + +int main() +{ + foo(); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-3.c new file mode 100644 index 000000000..9e8eb52ae --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-3.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-mpatch-functions-for-instrumentation --param function-patch-min-instructions=0" } */ + +/* Function should have nop-bytes with -mpatch-function-min-instructions=0. + Check there are nop-bytes at beginning and end of function. */ + +/* { dg-final { scan-assembler ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ +/* { dg-final { scan-assembler "ret(.*).byte\t0x90(.*).byte\t0x90" } } */ + +__attribute__ ((noinline)) +void foo() +{ + int x = 0; +} + +int main() +{ + foo(); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-4.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-4.c new file mode 100644 index 000000000..7a031d796 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-4.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-mpatch-functions-for-instrumentation -mpatch-functions-ignore-loops -mno-patch-functions-main-always" } */ + +/* Function is too small to be patched when ignoring the loop. + Check there aren't any nop-bytes at beginning and end of function. */ + +/* { dg-final { scan-assembler-not ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ +/* { dg-final { scan-assembler-not "ret(.*).byte\t0x90(.*).byte\t0x90" } } */ + +__attribute__ ((noinline)) +void foo() +{ + int x = 0; + while (++x); +} + +int main() +{ + foo(); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-5.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-5.c new file mode 100644 index 000000000..cd6a014cd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-5.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-mpatch-functions-for-instrumentation -mpatch-functions-ignore-loops --param function-patch-min-instructions=0" } */ + +/* Function should be patched with nop bytes with given options. + Check there are nop-bytes at beginning and end of function. */ + +/* { dg-final { scan-assembler ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ +/* { dg-final { scan-assembler "ret(.*).byte\t0x90(.*).byte\t0x90" } } */ + +__attribute__ ((noinline)) +void foo() +{ + int x = 0; + while (++x); +} + +int main() +{ + foo(); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-6.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-6.c new file mode 100644 index 000000000..c1d644686 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-6.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-mpatch-functions-for-instrumentation" } */ + +/* 'main' function should always be patched, irrespective of how small it is. + Check there are nop-bytes at beginning and end of main. */ + +/* { dg-final { scan-assembler ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ +/* { dg-final { scan-assembler "ret(.*).byte\t0x90(.*).byte\t0x90" } } */ + +int main() +{ + int x = 0; + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-7.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-7.c new file mode 100644 index 000000000..f625298d6 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-7.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-mpatch-functions-for-instrumentation -mno-patch-functions-main-always" } */ + +/* 'main' shouldn't be patched with the option -mno-patch-functions-main-always. + Check there aren't any nop-bytes at beginning and end of main. */ + +/* { dg-final { scan-assembler-not ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ +/* { dg-final { scan-assembler-not "ret(.*).byte\t0x90(.*).byte\t0x90" } } */ + +int main() +{ + int x = 0; + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-8.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-8.c new file mode 100644 index 000000000..436379cb2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-8.c @@ -0,0 +1,29 @@ +/* Verify -mpatch-functions-for-instrumentation works. */ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ + +/* -O2 forces a sibling call for foo from bar. */ +/* { dg-options "-O2 -mpatch-functions-for-instrumentation --param function-patch-min-instructions=0" } */ + +__attribute__ ((noinline)) +int foo() +{ + /* Dummy loop. */ + int x = 10; + int y = 100; + while (--x) + ++y; + return y; +} + +__attribute__ ((noinline)) +int bar() +{ + return foo(); +} + +int main() +{ + bar(); + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-force-no-patching.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-force-no-patching.c new file mode 100644 index 000000000..cad6f2da6 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-force-no-patching.c @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-mpatch-functions-for-instrumentation -mno-patch-functions-main-always" } */ + +/* Even complicated functions shouldn't get patched if they have the + never_patch_for_instrumentation attribute. */ + +/* { dg-final { scan-assembler-not ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ +/* { dg-final { scan-assembler-not "ret(.*).byte\t0x90(.*).byte\t0x90" } } */ + +__attribute__ ((never_patch_for_instrumentation)) +int foo () { + volatile unsigned x = 0; + volatile unsigned y = 1; + x += y; + x *= y; + while (++x) + foo (); + return y; +} + + +int main () +{ + int x = 0; + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-force-patching.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-force-patching.c new file mode 100644 index 000000000..86ad1594c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-force-patching.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O3 -mpatch-functions-for-instrumentation -mno-patch-functions-main-always" } */ + +/* Functions which have the always_patch attribute should be patched no matter + what. Check that there are nop-bytes at the beginning and end of the + function. We add -O3 so that the compiler will try to inline foo (but it + will be blocked by the attribute). */ + +/* { dg-final { scan-assembler ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ +/* { dg-final { scan-assembler "ret(.*).byte\t0x90(.*).byte\t0x90" } } */ + +__attribute__ ((always_patch_for_instrumentation)) +static int foo () { + return 3; +} + +int main () { + volatile int x = foo (); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-sibling-call.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-sibling-call.c new file mode 100644 index 000000000..847a95ce6 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/patch-functions-sibling-call.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ +/* -O2 forces a sibling call. */ +/* { dg-options "-O2 -mpatch-functions-for-instrumentation" } */ + +/* { dg-final { scan-assembler ".byte\t0xeb,0x09(.*).byte\t0x90" } } */ + +/* Checks correct nop-bytes are generated just before a sibling call. */ +/* { dg-final { scan-assembler ".byte\t0xeb,0x09(.*).byte\t0x90(.*)jmp" } } */ + +/* Not instrumented as function has no loop and is small. */ +__attribute__ ((noinline)) +int foo(int n) +{ + int x = 0; + return n + 10; +} + +__attribute__ ((noinline)) +int bar(int n) +{ + /* Dummy loop. */ + while (--n) + n = n * 2; + return foo(n); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c new file mode 100644 index 000000000..ae339bd9e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pie-copyrelocs-1.c @@ -0,0 +1,13 @@ +/* Test if -mcopyrelocs does the right thing. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fpie -mcopyrelocs" } */ + +extern int glob_a; + +int foo () +{ + return glob_a; +} + +/* glob_a should never be accessed with a GOTPCREL */ +/* { dg-final { scan-assembler-not "glob_a\\@GOTPCREL" { target { x86_64-*-* } } } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c new file mode 100644 index 000000000..ed60d0329 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pie-copyrelocs-2.c @@ -0,0 +1,13 @@ +/* Test if -mno-copyrelocs does the right thing. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fpie -mno-copyrelocs" } */ + +extern int glob_a; + +int foo () +{ + return glob_a; +} + +/* glob_a should always be accessed via GOT */ +/* { dg-final { scan-assembler "glob_a\\@GOT" { target { x86_64-*-* } } } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr50038.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr50038.c index e111574c4..8ec601dcb 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr50038.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr50038.c @@ -1,5 +1,5 @@ /* PR target/50038 */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize" } */ void test (int len, unsigned char *in, unsigned char *out) diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr57233.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr57233.c new file mode 100644 index 000000000..34182fa7d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr57233.c @@ -0,0 +1,15 @@ +/* PR tree-optimization/57233 */ +/* { dg-do compile { target avx } } */ +/* { dg-options "-O2 -mavx -mno-xop" } */ + +typedef unsigned V4 __attribute__((vector_size(4 * sizeof (int)))); +V4 a; + +__attribute__((noinline)) void +foo (void) +{ + a = (a << 2) | (a >> 30); +} + +/* { dg-final { scan-assembler "vpsrld\[^\n\r]*30" } } */ +/* { dg-final { scan-assembler "vpslld\[^\n\r]*2" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60868.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60868.c new file mode 100644 index 000000000..c30bbfc18 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60868.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O0 -minline-all-stringops -minline-stringops-dynamically -march=core2" } */ + +void bar (float *); + +void foo (void) +{ + float b[256] = {0}; + bar(b); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60901.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60901.c new file mode 100644 index 000000000..f0f25a1dc --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60901.c @@ -0,0 +1,17 @@ +/* { dg-options "-O -fselective-scheduling -fschedule-insns -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-tree-dominator-opts" } */ + +extern int n; +extern void bar (void); +extern int baz (int); + +void +foo (void) +{ + int i, j; + for (j = 0; j < n; j++) + { + for (i = 1; i < j; i++) + bar (); + baz (0); + } +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c new file mode 100644 index 000000000..b81dcd76f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60902.c @@ -0,0 +1,32 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ +extern void abort (); +extern void exit (int); + +int x; + +foo() +{ + static int count; + count++; + if (count > 1) + abort (); +} + +static inline int +frob () +{ + int a; + __asm__ ("mov %1, %0\n\t" : "=r" (a) : "m" (x)); + x++; + return a; +} + +int +main () +{ + int i; + for (i = 0; i < 10 && frob () == 0; i++) + foo(); + exit (0); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-1.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-1.c new file mode 100644 index 000000000..5a1ac3c0f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-1.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-mrdrnd" } */ + +extern void bar (int); + +void +foo (unsigned *u) +{ + int i = __builtin_ia32_rdrand32_step (u); + bar (i); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-2.c new file mode 100644 index 000000000..dd356685b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr60909-2.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-mrdseed" } */ + +extern void bar (int); + +void +foo (unsigned *u) +{ + int i = __builtin_ia32_rdseed_si_step (u); + bar (i); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61423.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61423.c new file mode 100644 index 000000000..5b538a265 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61423.c @@ -0,0 +1,38 @@ +/* PR target/61423 */ +/* { dg-do run { target ia32 } } */ +/* { dg-options "-O1 -ftree-vectorize -msse2 -mfpmath=387 -mtune=core2" } */ + +#define N 1024 +static unsigned int A[N]; + +double +__attribute__((noinline)) +func (void) +{ + unsigned int sum = 0; + unsigned i; + double t; + + for (i = 0; i < N; i++) + sum += A[i]; + + t = sum; + return t; +} + +int +main () +{ + unsigned i; + double d; + + for(i = 0; i < N; i++) + A[i] = 1; + + d = func(); + + if (d != 1024.0) + __builtin_abort (); + + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61446.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61446.c new file mode 100644 index 000000000..fc32f63ee --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61446.c @@ -0,0 +1,14 @@ +/* PR rtl-optimization/61446 */ + +/* { dg-do compile { target { ia32 } } } */ +/* { dg-options "-O2 -march=corei7 -mfpmath=387" } */ + +unsigned long long +foo (float a) +{ + const double dfa = a; + const unsigned int hi = dfa / 0x1p32f; + const unsigned int lo = dfa - (double) hi * 0x1p32f; + + return ((unsigned long long) hi << (4 * (8))) | lo; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-1.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-1.c new file mode 100644 index 000000000..4eec99253 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-1.c @@ -0,0 +1,13 @@ +/* PR target/61599 */ +/* { dg-options "-mcmodel=medium -fdata-sections" { target lp64 } } */ +/* { dg-do compile { target lp64 } } */ + +char a[1*1024*1024*1024]; +char b[1*1024*1024*1024]; +char c[1*1024*1024*1024]; + +extern int bar(); +int main() +{ + return bar() + c[225]; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-2.c new file mode 100644 index 000000000..22a53a45d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/pr61599-2.c @@ -0,0 +1,13 @@ +/* PR target/61599 */ +/* With -mcmodel=medium, all the arrays will be treated as large data. */ +/* { dg-options "-mcmodel=medium -fdata-sections" { target lp64 } } */ +/* { dg-do compile { target lp64 } } */ + +extern char a[]; +extern char b[]; +extern char c[]; + +int bar() +{ + return a[2] + b[16] + c[256]; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c index 9cf3cc81b..efc73f91c 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c @@ -31,4 +31,4 @@ void t3(void) r[i] = sqrtf (a[i]); } -/* { dg-final { scan-assembler-times "vrsqrtps\[ \\t\]+\[^\n\]*%ymm" 3 } } */ +/* { dg-final { scan-assembler "vrsqrtps\[ \\t\]+\[^\n\]*%ymm" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/sse2-pr57233.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse2-pr57233.c new file mode 100644 index 000000000..8a3bb2fc5 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse2-pr57233.c @@ -0,0 +1,16 @@ +/* PR tree-optimization/57233 */ +/* { dg-do run { target sse2 } } */ +/* { dg-options "-O2 -msse2" } */ + +#include "sse2-check.h" + +static void +sse2_test (void) +{ + do_main (); +} + +#undef main +#define main() do_main () + +#include "../../gcc.dg/pr57233.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/sse2-unaligned-mov.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse2-unaligned-mov.c new file mode 100644 index 000000000..28470cec4 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse2-unaligned-mov.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-mtune=corei7 -O2" } */ + +#include + +double a[1000]; + +__m128d foo1() { + __m128d res; + res = _mm_load_sd(&a[1]); + res = _mm_loadh_pd(res, &a[2]); + return res; +} + +void foo2(__m128d res) { + _mm_store_sd(&a[1], res); + _mm_storeh_pd(&a[2], res); +} + +/* { dg-final { scan-assembler-times "movup" 2 } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-1.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-1.c index 96dd8a6a7..fc92e6824 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-1.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-1.c @@ -1,6 +1,6 @@ /* { dg-do run } */ /* { dg-require-effective-target sse4 } */ -/* { dg-options "-O2 -msse4.1" } */ +/* { dg-options "-O2 -msse4.1 --param max-default-completely-peeled-insns=0" } */ /* { dg-skip-if "no M_PI" { vxworks_kernel } } */ #include "sse4_1-check.h" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-2.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-2.c index f052c029f..72e6807fe 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-2.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-2.c @@ -1,6 +1,6 @@ /* { dg-do run } */ /* { dg-require-effective-target sse4 } */ -/* { dg-options "-O2 -msse4.1" } */ +/* { dg-options "-O2 -msse4.1 --param max-default-completely-peeled-insns=0" } */ /* { dg-skip-if "no M_PI" { vxworks_kernel } } */ #include "sse4_1-check.h" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-3.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-3.c index 0a696b1cf..0af7ea783 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-3.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/sse4_1-roundss-3.c @@ -1,6 +1,6 @@ /* { dg-do run } */ /* { dg-require-effective-target sse4 } */ -/* { dg-options "-O2 -msse4.1" } */ +/* { dg-options "-O2 -msse4.1 --param max-default-completely-peeled-insns=0" } */ /* { dg-skip-if "no M_PI" { vxworks_kernel } } */ #include "sse4_1-check.h" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/vec-may_alias.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/vec-may_alias.c new file mode 100644 index 000000000..e97049745 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/vec-may_alias.c @@ -0,0 +1,25 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -w -Wno-abi" } */ + +typedef int v2si __attribute__ ((vector_size (8))); +typedef short v4hi __attribute__ ((vector_size (8))); +typedef short v4hia __attribute__ ((vector_size (8), may_alias)); + +__attribute__ ((noinline, noclone)) +int f (v2si A, int N) +{ return ((v4hia)A)[N]; } + +__attribute__ ((noinline, noclone)) +int g (v2si A, int N) +{ return ((v4hi)A)[N]; } + +int main() +{ + v2si x = { 0, 0 }, y = { 1, 1 }; + if (f (x, 0) || f (x, 1) || f (x, 2) || f (x, 3)) + __builtin_abort (); + if (g (y, 0) != 1 || g (y, 1) || g (y, 2) != 1 || g (y, 3)) + __builtin_abort (); + return 0; +} + diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/wmul-1.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/wmul-1.c index 4ef8385ef..b8fd06a56 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/wmul-1.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/wmul-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize" } */ /* { dg-require-effective-target ia32 } */ long long mac(const int *a, const int *b, long long sqr, long long *sum) diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/xop-pr57233.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/xop-pr57233.c new file mode 100644 index 000000000..6129dc217 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/xop-pr57233.c @@ -0,0 +1,16 @@ +/* PR tree-optimization/57233 */ +/* { dg-do run { target xop } } */ +/* { dg-options "-O2 -mxop" } */ + +#include "xop-check.h" + +static void +xop_test (void) +{ + do_main (); +} + +#undef main +#define main() do_main () + +#include "../../gcc.dg/pr57233.c" diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-1.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-1.c new file mode 100644 index 000000000..c7496c235 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-1.c @@ -0,0 +1,27 @@ +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mcpu=power7 -O2" } */ +/* { dg-final { scan-assembler-times "cdtbcd " 1 } } */ +/* { dg-final { scan-assembler-times "cbcdtd " 1 } } */ +/* { dg-final { scan-assembler-times "addg6s " 1 } } */ +/* { dg-final { scan-assembler-not "bl __builtin" } } */ + +unsigned int +to_bcd (unsigned int a) +{ + return __builtin_cdtbcd (a); +} + +unsigned int +from_bcd (unsigned int a) +{ + return __builtin_cbcdtd (a); +} + +unsigned int +bcd_arith (unsigned int a, unsigned int b) +{ + return __builtin_addg6s (a, b); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-2.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-2.c new file mode 100644 index 000000000..d330b7423 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-2.c @@ -0,0 +1,44 @@ +/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mcpu=power8 -O2" } */ +/* { dg-final { scan-assembler-times "bcdadd\[.\] " 2 } } */ +/* { dg-final { scan-assembler-times "bcdsub\[.\] " 2 } } */ +/* { dg-final { scan-assembler-not "bl __builtin" } } */ +/* { dg-final { scan-assembler-not "mtvsr" } } */ +/* { dg-final { scan-assembler-not "mfvsr" } } */ +/* { dg-final { scan-assembler-not "lvx" } } */ +/* { dg-final { scan-assembler-not "lxvw4x" } } */ +/* { dg-final { scan-assembler-not "lxvd2x" } } */ +/* { dg-final { scan-assembler-not "stvx" } } */ +/* { dg-final { scan-assembler-not "stxvw4x" } } */ +/* { dg-final { scan-assembler-not "stxvd2x" } } */ + +typedef __int128_t __attribute__((__vector_size__(16))) vector_128_t; +typedef __int128_t scalar_128_t; +typedef unsigned long long scalar_64_t; + +vector_128_t +do_add_0 (vector_128_t a, vector_128_t b) +{ + return __builtin_bcdadd (a, b, 0); +} + +vector_128_t +do_add_1 (vector_128_t a, vector_128_t b) +{ + return __builtin_bcdadd (a, b, 1); +} + +vector_128_t +do_sub_0 (vector_128_t a, vector_128_t b) +{ + return __builtin_bcdsub (a, b, 0); +} + +vector_128_t +do_sub_1 (vector_128_t a, vector_128_t b) +{ + return __builtin_bcdsub (a, b, 1); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-3.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-3.c new file mode 100644 index 000000000..436cecf6f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/bcd-3.c @@ -0,0 +1,103 @@ +/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mcpu=power8 -O2" } */ +/* { dg-final { scan-assembler-times "bcdadd\[.\] " 4 } } */ +/* { dg-final { scan-assembler-times "bcdsub\[.\] " 4 } } */ +/* { dg-final { scan-assembler-not "bl __builtin" } } */ +/* { dg-final { scan-assembler-not "mtvsr" } } */ +/* { dg-final { scan-assembler-not "mfvsr" } } */ +/* { dg-final { scan-assembler-not "lvx" } } */ +/* { dg-final { scan-assembler-not "lxvw4x" } } */ +/* { dg-final { scan-assembler-not "lxvd2x" } } */ +/* { dg-final { scan-assembler-not "stvx" } } */ +/* { dg-final { scan-assembler-not "stxvw4x" } } */ +/* { dg-final { scan-assembler-not "stxvd2x" } } */ + +typedef __int128_t __attribute__((__vector_size__(16))) vector_128_t; +typedef __int128_t scalar_128_t; +typedef unsigned long long scalar_64_t; + +/* Test whether the peephole works to allow folding a bcdadd, with a + bcdadd_ into a single instruction. */ + +vector_128_t +do_add_lt (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdadd (a, b, 0); + if (__builtin_bcdadd_lt (a, b, 0)) + *p = 1; + + return ret; +} + +vector_128_t +do_add_eq (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdadd (a, b, 0); + if (__builtin_bcdadd_eq (a, b, 0)) + *p = 1; + + return ret; +} + +vector_128_t +do_add_gt (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdadd (a, b, 0); + if (__builtin_bcdadd_gt (a, b, 0)) + *p = 1; + + return ret; +} + +vector_128_t +do_add_ov (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdadd (a, b, 0); + if (__builtin_bcdadd_ov (a, b, 0)) + *p = 1; + + return ret; +} + +vector_128_t +do_sub_lt (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdsub (a, b, 0); + if (__builtin_bcdsub_lt (a, b, 0)) + *p = 1; + + return ret; +} + +vector_128_t +do_sub_eq (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdsub (a, b, 0); + if (__builtin_bcdsub_eq (a, b, 0)) + *p = 1; + + return ret; +} + +vector_128_t +do_sub_gt (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdsub (a, b, 0); + if (__builtin_bcdsub_gt (a, b, 0)) + *p = 1; + + return ret; +} + +vector_128_t +do_sub_ov (vector_128_t a, vector_128_t b, int *p) +{ + vector_128_t ret = __builtin_bcdsub (a, b, 0); + if (__builtin_bcdsub_ov (a, b, 0)) + *p = 1; + + return ret; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/dfp-builtin-1.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/dfp-builtin-1.c new file mode 100644 index 000000000..614f27264 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/dfp-builtin-1.c @@ -0,0 +1,88 @@ +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mcpu=power7 -O2" } */ +/* { dg-final { scan-assembler-times "ddedpd " 4 } } */ +/* { dg-final { scan-assembler-times "denbcd " 2 } } */ +/* { dg-final { scan-assembler-times "dxex " 1 } } */ +/* { dg-final { scan-assembler-times "diex " 1 } } */ +/* { dg-final { scan-assembler-times "dscli " 2 } } */ +/* { dg-final { scan-assembler-times "dscri " 2 } } */ +/* { dg-final { scan-assembler-not "bl __builtin" } } */ +/* { dg-final { scan-assembler-not "dctqpq" } } */ +/* { dg-final { scan-assembler-not "drdpq" } } */ +/* { dg-final { scan-assembler-not "stfd" } } */ +/* { dg-final { scan-assembler-not "lfd" } } */ + +_Decimal64 +do_dedpd_0 (_Decimal64 a) +{ + return __builtin_ddedpd (0, a); +} + +_Decimal64 +do_dedpd_1 (_Decimal64 a) +{ + return __builtin_ddedpd (1, a); +} + +_Decimal64 +do_dedpd_2 (_Decimal64 a) +{ + return __builtin_ddedpd (2, a); +} + +_Decimal64 +do_dedpd_3 (_Decimal64 a) +{ + return __builtin_ddedpd (3, a); +} + +_Decimal64 +do_enbcd_0 (_Decimal64 a) +{ + return __builtin_denbcd (0, a); +} + +_Decimal64 +do_enbcd_1 (_Decimal64 a) +{ + return __builtin_denbcd (1, a); +} + +_Decimal64 +do_xex (_Decimal64 a) +{ + return __builtin_dxex (a); +} + +_Decimal64 +do_iex (_Decimal64 a, _Decimal64 b) +{ + return __builtin_diex (a, b); +} + +_Decimal64 +do_scli_1 (_Decimal64 a) +{ + return __builtin_dscli (a, 1); +} + +_Decimal64 +do_scli_10 (_Decimal64 a) +{ + return __builtin_dscli (a, 10); +} + +_Decimal64 +do_scri_1 (_Decimal64 a) +{ + return __builtin_dscri (a, 1); +} + +_Decimal64 +do_scri_10 (_Decimal64 a) +{ + return __builtin_dscri (a, 10); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/dfp-builtin-2.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/dfp-builtin-2.c new file mode 100644 index 000000000..189bc9ad6 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/dfp-builtin-2.c @@ -0,0 +1,88 @@ +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mcpu=power7 -O2" } */ +/* { dg-final { scan-assembler-times "ddedpdq " 4 } } */ +/* { dg-final { scan-assembler-times "denbcdq " 2 } } */ +/* { dg-final { scan-assembler-times "dxexq " 1 } } */ +/* { dg-final { scan-assembler-times "diexq " 1 } } */ +/* { dg-final { scan-assembler-times "dscliq " 2 } } */ +/* { dg-final { scan-assembler-times "dscriq " 2 } } */ +/* { dg-final { scan-assembler-not "bl __builtin" } } */ +/* { dg-final { scan-assembler-not "dctqpq" } } */ +/* { dg-final { scan-assembler-not "drdpq" } } */ +/* { dg-final { scan-assembler-not "stfd" } } */ +/* { dg-final { scan-assembler-not "lfd" } } */ + +_Decimal128 +do_dedpdq_0 (_Decimal128 a) +{ + return __builtin_ddedpdq (0, a); +} + +_Decimal128 +do_dedpdq_1 (_Decimal128 a) +{ + return __builtin_ddedpdq (1, a); +} + +_Decimal128 +do_dedpdq_2 (_Decimal128 a) +{ + return __builtin_ddedpdq (2, a); +} + +_Decimal128 +do_dedpdq_3 (_Decimal128 a) +{ + return __builtin_ddedpdq (3, a); +} + +_Decimal128 +do_enbcdq_0 (_Decimal128 a) +{ + return __builtin_denbcdq (0, a); +} + +_Decimal128 +do_enbcdq_1 (_Decimal128 a) +{ + return __builtin_denbcdq (1, a); +} + +_Decimal128 +do_xexq (_Decimal128 a) +{ + return __builtin_dxexq (a); +} + +_Decimal128 +do_iexq (_Decimal128 a, _Decimal128 b) +{ + return __builtin_diexq (a, b); +} + +_Decimal128 +do_scliq_1 (_Decimal128 a) +{ + return __builtin_dscliq (a, 1); +} + +_Decimal128 +do_scliq_10 (_Decimal128 a) +{ + return __builtin_dscliq (a, 10); +} + +_Decimal128 +do_scriq_1 (_Decimal128 a) +{ + return __builtin_dscriq (a, 1); +} + +_Decimal128 +do_scriq_10 (_Decimal128 a) +{ + return __builtin_dscriq (a, 10); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/extend-divide-1.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/extend-divide-1.c new file mode 100644 index 000000000..5f948b721 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/extend-divide-1.c @@ -0,0 +1,34 @@ +/* { dg-do compile { target { powerpc*-*-linux* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mcpu=power7 -O2" } */ +/* { dg-final { scan-assembler-times "divwe " 1 } } */ +/* { dg-final { scan-assembler-times "divweo " 1 } } */ +/* { dg-final { scan-assembler-times "divweu " 1 } } */ +/* { dg-final { scan-assembler-times "divweuo " 1 } } */ +/* { dg-final { scan-assembler-not "bl __builtin" } } */ + +int +div_we (int a, int b) +{ + return __builtin_divwe (a, b); +} + +int +div_weo (int a, int b) +{ + return __builtin_divweo (a, b); +} + +unsigned int +div_weu (unsigned int a, unsigned int b) +{ + return __builtin_divweu (a, b); +} + +unsigned int +div_weuo (unsigned int a, unsigned int b) +{ + return __builtin_divweuo (a, b); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/extend-divide-2.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/extend-divide-2.c new file mode 100644 index 000000000..8ee6c8cf7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/extend-divide-2.c @@ -0,0 +1,34 @@ +/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-mcpu=power7 -O2" } */ +/* { dg-final { scan-assembler-times "divde " 1 } } */ +/* { dg-final { scan-assembler-times "divdeo " 1 } } */ +/* { dg-final { scan-assembler-times "divdeu " 1 } } */ +/* { dg-final { scan-assembler-times "divdeuo " 1 } } */ +/* { dg-final { scan-assembler-not "bl __builtin" } } */ + +long +div_de (long a, long b) +{ + return __builtin_divde (a, b); +} + +long +div_deo (long a, long b) +{ + return __builtin_divdeo (a, b); +} + +unsigned long +div_deu (unsigned long a, unsigned long b) +{ + return __builtin_divdeu (a, b); +} + +unsigned long +div_deuo (unsigned long a, unsigned long b) +{ + return __builtin_divdeuo (a, b); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/htm-ttest.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/htm-ttest.c new file mode 100644 index 000000000..29cbd5b90 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/htm-ttest.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_htm_ok } */ +/* { dg-options "-O2 -mhtm" } */ + +/* { dg-final { scan-assembler "rlwinm r?\[0-9\]+,r?\[0-9\]+,3,30,31" { target { ilp32 } } } } */ +/* { dg-final { scan-assembler "rldicl r?\[0-9\]+,r?\[0-9\]+,35,62" { target { lp64 } } } } */ + +#include +long +ttest (void) +{ + return _HTM_STATE(__builtin_ttest()); +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack01.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack01.c new file mode 100644 index 000000000..efac4087c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack01.c @@ -0,0 +1,91 @@ +/* { dg-do run { target { powerpc*-*-linux* && lp64 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target p8vector_hw } */ +/* { dg-options "-mcpu=power8 -O2" } */ + +#include +#include +#include + +#ifdef DEBUG +#include +#endif + +typedef __int128_t __attribute__((__vector_size__(16))) vector_128_t; +typedef __int128_t scalar_128_t; +typedef unsigned long long scalar_64_t; + +volatile scalar_64_t one = 1; +volatile scalar_64_t two = 2; + +int +main (void) +{ + scalar_128_t a = (((scalar_128_t)one) << 64) | ((scalar_128_t)two); + vector_128_t v1 = (vector_128_t) { a }; + vector_128_t v2 = __builtin_pack_vector_int128 (one, two); + scalar_64_t x0 = __builtin_unpack_vector_int128 (v1, 0); + scalar_64_t x1 = __builtin_unpack_vector_int128 (v1, 1); + vector_128_t v3 = __builtin_pack_vector_int128 (x0, x1); + + size_t i; + union { + scalar_128_t i128; + vector_128_t v128; + scalar_64_t u64; + unsigned char uc[sizeof (scalar_128_t)]; + char c[sizeof (scalar_128_t)]; + } u, u2; + +#ifdef DEBUG + { + printf ("a = 0x"); + u.i128 = a; + for (i = 0; i < sizeof (scalar_128_t); i++) + printf ("%.2x", u.uc[i]); + + printf ("\nv1 = 0x"); + u.v128 = v1; + for (i = 0; i < sizeof (scalar_128_t); i++) + printf ("%.2x", u.uc[i]); + + printf ("\nv2 = 0x"); + u.v128 = v2; + for (i = 0; i < sizeof (scalar_128_t); i++) + printf ("%.2x", u.uc[i]); + + printf ("\nv3 = 0x"); + u.v128 = v3; + for (i = 0; i < sizeof (scalar_128_t); i++) + printf ("%.2x", u.uc[i]); + + printf ("\nx0 = 0x"); + u.u64 = x0; + for (i = 0; i < sizeof (scalar_64_t); i++) + printf ("%.2x", u.uc[i]); + + printf ("\nx1 = 0x"); + u.u64 = x1; + for (i = 0; i < sizeof (scalar_64_t); i++) + printf ("%.2x", u.uc[i]); + + printf ("\n"); + } +#endif + + u2.i128 = a; + u.v128 = v1; + if (memcmp (u.c, u2.c, sizeof (scalar_128_t)) != 0) + abort (); + + u.v128 = v2; + if (memcmp (u.c, u2.c, sizeof (scalar_128_t)) != 0) + abort (); + + u.v128 = v3; + if (memcmp (u.c, u2.c, sizeof (scalar_128_t)) != 0) + abort (); + + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack02.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack02.c new file mode 100644 index 000000000..f85d3ff00 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack02.c @@ -0,0 +1,96 @@ +/* { dg-do run { target { powerpc*-*-linux* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_fprs } */ +/* { dg-require-effective-target longdouble128 } */ +/* { dg-options "-O2 -mhard-float" } */ + +#include +#include +#include + +#ifdef DEBUG +#include +#endif + +int +main (void) +{ + double high = pow (2.0, 60); + double low = 2.0; + long double a = ((long double)high) + ((long double)low); + double x0 = __builtin_unpack_longdouble (a, 0); + double x1 = __builtin_unpack_longdouble (a, 1); + long double b = __builtin_pack_longdouble (x0, x1); + +#ifdef DEBUG + { + size_t i; + union { + long double ld; + double d; + unsigned char uc[sizeof (long double)]; + char c[sizeof (long double)]; + } u; + + printf ("a = 0x"); + u.ld = a; + for (i = 0; i < sizeof (long double); i++) + printf ("%.2x", u.uc[i]); + + printf (", %Lg\n", a); + + printf ("b = 0x"); + u.ld = b; + for (i = 0; i < sizeof (long double); i++) + printf ("%.2x", u.uc[i]); + + printf (", %Lg\n", b); + + printf ("hi = 0x"); + u.d = high; + for (i = 0; i < sizeof (double); i++) + printf ("%.2x", u.uc[i]); + + printf (",%*s %g\n", (int)(2 * (sizeof (long double) - sizeof (double))), "", high); + + printf ("lo = 0x"); + u.d = low; + for (i = 0; i < sizeof (double); i++) + printf ("%.2x", u.uc[i]); + + printf (",%*s %g\n", (int)(2 * (sizeof (long double) - sizeof (double))), "", low); + + printf ("x0 = 0x"); + u.d = x0; + for (i = 0; i < sizeof (double); i++) + printf ("%.2x", u.uc[i]); + + printf (",%*s %g\n", (int)(2 * (sizeof (long double) - sizeof (double))), "", x0); + + printf ("x1 = 0x"); + u.d = x1; + for (i = 0; i < sizeof (double); i++) + printf ("%.2x", u.uc[i]); + + printf (",%*s %g\n", (int)(2 * (sizeof (long double) - sizeof (double))), "", x1); + } +#endif + + if (high != x0) + abort (); + + if (low != x1) + abort (); + + if (a != b) + abort (); + + if (x0 != high) + abort (); + + if (x1 != low) + abort (); + + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack03.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack03.c new file mode 100644 index 000000000..dfaf2efa0 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pack03.c @@ -0,0 +1,88 @@ +/* { dg-do run { target { powerpc*-*-linux* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ +/* { dg-require-effective-target dfp_hw } */ +/* { dg-options "-O2 -mhard-dfp" } */ + +#include +#include +#include + +#ifdef DEBUG +#include +#endif + +int +main (void) +{ + _Decimal128 one = (_Decimal128)1.0; + _Decimal128 two = (_Decimal128)2.0; + _Decimal128 ten = (_Decimal128)10.0; + _Decimal128 a = one; + _Decimal128 b; + _Decimal128 c; + unsigned long long x0; + unsigned long long x1; + size_t i; + + for (i = 0; i < 25; i++) + a *= ten; + + a += two; + + x0 = __builtin_unpack_dec128 (a, 0); + x1 = __builtin_unpack_dec128 (a, 1); + b = __builtin_pack_dec128 (x0, x1); + c = __builtin_dscliq (one, 25) + two; + +#ifdef DEBUG + { + union { + _Decimal128 d; + unsigned long long ull; + unsigned char uc[sizeof (_Decimal128)]; + } u; + + printf ("a = 0x"); + u.d = a; + for (i = 0; i < sizeof (_Decimal128); i++) + printf ("%.2x", u.uc[i]); + + printf (", %Lg\n", (long double)a); + + printf ("b = 0x"); + u.d = b; + for (i = 0; i < sizeof (_Decimal128); i++) + printf ("%.2x", u.uc[i]); + + printf (", %Lg\n", (long double)b); + + printf ("c = 0x"); + u.d = c; + for (i = 0; i < sizeof (_Decimal128); i++) + printf ("%.2x", u.uc[i]); + + printf (", %Lg\n", (long double)c); + + printf ("x0 = 0x"); + u.ull = x0; + for (i = 0; i < sizeof (unsigned long long); i++) + printf ("%.2x", u.uc[i]); + + printf ("\nx1 = 0x"); + u.ull = x1; + for (i = 0; i < sizeof (unsigned long long); i++) + printf ("%.2x", u.uc[i]); + + printf ("\n"); + } +#endif + + if (a != b) + abort (); + + if (a != c) + abort (); + + return 0; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr60735.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr60735.c new file mode 100644 index 000000000..9bac30b51 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/pr60735.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-mcpu=8548 -mspe -mabi=spe -O2" } */ +/* { dg-skip-if "not an SPE target" { ! powerpc_spe_nocache } { "*" } { "" } } */ + +/* In PR60735, the type _Decimal64 generated an insn not found message. */ + +void +pr60735 (_Decimal64 *p, _Decimal64 *q) +{ + *p = *q; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/tfmode_off.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/tfmode_off.c index e6578ef31..ea703f0ee 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/tfmode_off.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/tfmode_off.c @@ -1,6 +1,7 @@ /* { dg-do assemble } */ /* { dg-skip-if "" { powerpc-ibm-aix* } { "*" } { "" } } */ /* { dg-skip-if "no TFmode" { powerpc-*-eabi* } { "*" } { "" } } */ +/* { dg-require-effective-target longdouble128 } */ /* { dg-options "-O2 -fno-align-functions -mtraceback=no -save-temps" } */ typedef float TFmode __attribute__ ((mode (TF))); diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ti_math1.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ti_math1.c new file mode 100644 index 000000000..cdf925100 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ti_math1.c @@ -0,0 +1,20 @@ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-times "addc" 1 } } */ +/* { dg-final { scan-assembler-times "adde" 1 } } */ +/* { dg-final { scan-assembler-times "subfc" 1 } } */ +/* { dg-final { scan-assembler-times "subfe" 1 } } */ +/* { dg-final { scan-assembler-not "subf " } } */ + +__int128 +add_128 (__int128 *ptr, __int128 val) +{ + return (*ptr + val); +} + +__int128 +sub_128 (__int128 *ptr, __int128 val) +{ + return (*ptr - val); +} + diff --git a/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ti_math2.c b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ti_math2.c new file mode 100644 index 000000000..b9c03300d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/powerpc/ti_math2.c @@ -0,0 +1,73 @@ +/* { dg-do run { target { powerpc*-*-* && lp64 } } } */ +/* { dg-options "-O2 -fno-inline" } */ + +union U { + __int128 i128; + struct { + long l1; + long l2; + } s; +}; + +union U u1,u2; + +__int128 +create_128 (long most_sig, long least_sig) +{ + union U u; + +#if __LITTLE_ENDIAN__ + u.s.l1 = least_sig; + u.s.l2 = most_sig; +#else + u.s.l1 = most_sig; + u.s.l2 = least_sig; +#endif + return u.i128; +} + +long most_sig (union U * u) +{ +#if __LITTLE_ENDIAN__ + return (*u).s.l2; +#else + return (*u).s.l1; +#endif +} + +long least_sig (union U * u) +{ +#if __LITTLE_ENDIAN__ + return (*u).s.l1; +#else + return (*u).s.l2; +#endif +} + +__int128 +add_128 (__int128 *ptr, __int128 val) +{ + return (*ptr + val); +} + +__int128 +sub_128 (__int128 *ptr, __int128 val) +{ + return (*ptr - val); +} + +int +main (void) +{ + /* Do a simple add/sub to make sure carry is happening between the dwords + and that dwords are in correct endian order. */ + u1.i128 = create_128 (1, -1); + u2.i128 = add_128 (&u1.i128, 1); + if ((most_sig (&u2) != 2) || (least_sig (&u2) != 0)) + __builtin_abort (); + u2.i128 = sub_128 (&u2.i128, 1); + if ((most_sig (&u2) != 1) || (least_sig (&u2) != -1)) + __builtin_abort (); + return 0; +} + diff --git a/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-2.c b/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-2.c deleted file mode 100644 index 59621a4c1..000000000 --- a/gcc-4.9/gcc/testsuite/gcc.target/s390/htm-nofloat-2.c +++ /dev/null @@ -1,55 +0,0 @@ -/* { dg-do run } */ -/* { dg-options "-O3 -mhtm -Wa,-march=zEC12,-mzarch --save-temps" } */ - -/* __builtin_tbegin has to emit clobbers for all FPRs since the tbegin - instruction does not automatically preserves them. If the - transaction body is fully contained in a function the backend tries - after reload to get rid of the FPR save/restore operations - triggered by the clobbers. This testcase failed since the backend - was able to get rid of all FPR saves/restores and since these were - the only stack operations also of the entire stack space. So even - the save/restore of the stack pointer was omitted in the end. - However, since the frame layout has been fixed before, the prologue - still generated the stack pointer decrement making foo return with - a modified stack pointer. */ - -void abort(void); - -void __attribute__((noinline)) -foo (int a) -{ - /* This is just to prevent the tbegin code from actually being - executed. That way the test may even run on machines prior to - zEC12. */ - if (a == 42) - return; - - if (__builtin_tbegin (0) == 0) - __builtin_tend (); -} - -#ifdef __s390x__ -#define GET_STACK_POINTER(SP) \ - asm volatile ("stg %%r15, %0" : "=QRST" (SP)); -#else -#define GET_STACK_POINTER(SP) \ - asm volatile ("st %%r15, %0" : "=QR" (SP)); -#endif - -int main(void) -{ - unsigned long new_sp, old_sp; - - GET_STACK_POINTER (old_sp); - foo(42); - GET_STACK_POINTER (new_sp); - - if (old_sp != new_sp) - abort (); - - return 0; -} - -/* Make sure no FPR saves/restores are emitted. */ -/* { dg-final { scan-assembler-not "\tstd\t" } } */ -/* { dg-final { scan-assembler-not "\tld\t" } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp b/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp index d6fc1874f..624b7ea75 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp +++ b/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/avx/abi-avx.exp @@ -20,6 +20,7 @@ load_lib c-torture.exp load_lib target-supports.exp load_lib torture-options.exp +load_lib clearcap.exp if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) || ![is-effective-target lp64] @@ -28,20 +29,10 @@ if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) } -# If the linker used understands -M , pass it to clear hardware -# capabilities set by the Sun assembler. -set flags "" -set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map" - -if [check_no_compiler_messages mapfile executable { - int main (void) { return 0; } - } $clearcap_ldflags ] { - set flags $clearcap_ldflags -} - torture-init +clearcap-init set-torture-options $C_TORTURE_OPTIONS -set additional_flags "-W -Wall -mavx $flags" +set additional_flags "-W -Wall -mavx" foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] { if {[runtest_file_p $runtests $src]} { @@ -58,4 +49,5 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] { } } +clearcap-finish torture-finish diff --git a/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/avx512f/abi-avx512f.exp b/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/avx512f/abi-avx512f.exp index cef6fa141..f8f991e92 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/avx512f/abi-avx512f.exp +++ b/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/avx512f/abi-avx512f.exp @@ -20,6 +20,7 @@ load_lib c-torture.exp load_lib target-supports.exp load_lib torture-options.exp +load_lib clearcap.exp if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) || ![is-effective-target lp64] @@ -28,20 +29,10 @@ if { (![istarget x86_64-*-*] && ![istarget i?86-*-*]) } -# If the linker used understands -M , pass it to clear hardware -# capabilities set by the Sun assembler. -set flags "" -set clearcap_ldflags "-Wl,-M,$srcdir/gcc.target/i386/clearcap.map" - -if [check_no_compiler_messages mapfile executable { - int main (void) { return 0; } - } $clearcap_ldflags ] { - set flags $clearcap_ldflags -} - torture-init +clearcap-init set-torture-options $C_TORTURE_OPTIONS -set additional_flags "-W -Wall -mavx512f $flags" +set additional_flags "-W -Wall -mavx512f" foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] { if {[runtest_file_p $runtests $src]} { @@ -58,4 +49,5 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/test_*.c]] { } } +clearcap-finish torture-finish diff --git a/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/callabi/leaf-2.c b/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/callabi/leaf-2.c index 2a54bc89c..df4c4068b 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/callabi/leaf-2.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/x86_64/abi/callabi/leaf-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mabi=sysv" } */ +/* { dg-options "-O2 -fno-tree-loop-vectorize -mabi=sysv" } */ extern int glb1, gbl2, gbl3; diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 new file mode 100644 index 000000000..48f6dd216 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/allocatable_function_8.f90 @@ -0,0 +1,59 @@ +! { dg-do run } +! Test the fix for PR61459 and PR58883. +! +! Contributed by John Wingate +! and Tao Song +! +module a + + implicit none + private + public :: f_segfault, f_segfault_plus, f_workaround + integer, dimension(2,2) :: b = reshape([1,-1,1,1],[2,2]) + +contains + + function f_segfault(x) + real, dimension(:), allocatable :: f_segfault + real, dimension(:), intent(in) :: x + allocate(f_segfault(2)) + f_segfault = matmul(b,x) + end function f_segfault + +! Sefaulted without the ALLOCATE as well. + function f_segfault_plus(x) + real, dimension(:), allocatable :: f_segfault_plus + real, dimension(:), intent(in) :: x + f_segfault_plus = matmul(b,x) + end function f_segfault_plus + + function f_workaround(x) + real, dimension(:), allocatable :: f_workaround + real, dimension(:), intent(in) :: x + real, dimension(:), allocatable :: tmp + allocate(f_workaround(2),tmp(2)) + tmp = matmul(b,x) + f_workaround = tmp + end function f_workaround + +end module a + +program main + use a + implicit none + real, dimension(2) :: x = 1.0, y +! PR61459 + y = f_workaround (x) + if (any (f_segfault (x) .ne. y)) call abort + if (any (f_segfault_plus (x) .ne. y)) call abort +! PR58883 + if (any (foo () .ne. reshape([1,2,3,4,5,6,7,8],[2,4]))) call abort +contains + function foo() + integer, allocatable :: foo(:,:) + integer, allocatable :: temp(:) + + temp = [1,2,3,4,5,6,7,8] + foo = reshape(temp,[2,4]) + end function +end program main diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_14.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_14.f90 new file mode 100644 index 000000000..3d878c756 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_14.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! PR61173.f90 Bogus END condition +module bd + character(len=25, kind=1), dimension(:), allocatable, save :: source + contains + subroutine init_data + allocate(source(2)) + source=[" 1 1 1 ", " 4 4 4 "] + end subroutine init_data +end module bd +program read_internal + use bd + integer :: x(6),i + + call init_data + read(source,*) (x(i), i=1,6) + if (any(x/=[1,1,1,4,4,4])) call abort +end program read_internal diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_15.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_15.f90 new file mode 100644 index 000000000..df497dc02 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_15.f90 @@ -0,0 +1,11 @@ +! { dg-do run } +! PR61499 +program read_internal + + integer :: x(9),i,iostat + character(len=512) :: iomsg + character(kind=1,len=30), dimension(:), allocatable, save :: source + allocate(source(3)) + source=[" 1 1 -1"," 1 -1 1"," -1 1 1"] !This fails + read(source,*) (x(i), i=1,6) +end program read_internal diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_16.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_16.f90 new file mode 100644 index 000000000..46814ae5d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/arrayio_16.f90 @@ -0,0 +1,13 @@ +! { dg-do run } +! PR61640 KIND=4 Character Array Internal Unit Read Fail +program read_internal + integer :: x(9),i + integer :: y(9) + character(kind=4,len=30), dimension(3) :: source + + y = reshape ((/ 1,1,-1,1,-1,1,-1,1,1 /), shape(x)) + source=[4_" 1 1 -1",4_" 1 -1 1",4_" -1 1 1"] + !print *, (trim(source(i)), i=1,3) + read(source,*) (x(i), i=1,9) ! This read fails for KIND=4 character + if (any(x /= y )) call abort +end program read_internal diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/associate_16.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/associate_16.f90 new file mode 100644 index 000000000..9129388b2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/associate_16.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! PR 60834 - this used to ICE. + +module m + implicit none + type :: t + real :: diffusion=1. + end type +contains + subroutine solve(this, x) + class(t), intent(in) :: this + real, intent(in) :: x(:) + integer :: i + integer, parameter :: n(1:5)=[(i,i=1, 5)] + + associate( nu=>this%diffusion) + associate( exponential=>exp(-(x(i)-n) )) + do i = 1, size(x) + end do + end associate + end associate + end subroutine solve +end module m diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/associate_17.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/associate_17.f90 new file mode 100644 index 000000000..5c39cf062 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/associate_17.f90 @@ -0,0 +1,12 @@ +! { dg-do run } +! Test the fix for PR61406 +! Contributed by Adam Hirst +program test + implicit none + real :: theta = 1.0 + + associate (n => [cos(theta), sin(theta)]) + if (abs (norm2(n) - 1.0) .gt. 1.0e-4) call abort + end associate + +end program test diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/class_array_15.f03 b/gcc-4.9/gcc/testsuite/gfortran.dg/class_array_15.f03 index 7d1d4d718..d3a123259 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/class_array_15.f03 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/class_array_15.f03 @@ -1,4 +1,5 @@ ! { dg-do run } +! { dg-options "-fdump-tree-original" } ! ! Tests the fixes for three bugs with the same underlying cause. All are regressions ! that come about because class array elements end up with a different tree type @@ -114,3 +115,5 @@ subroutine pr54992 ! This test remains as the original. bh => bhGet(b,instance=2) if (loc (b) .ne. loc(bh%hostNode)) call abort end +! { dg-final { scan-tree-dump-times "builtin_free" 12 "original" } } +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 new file mode 100644 index 000000000..1ac98f3ea --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/cray_pointers_10.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! { dg-options "-fcray-pointer" } +! +! PR fortran/45187 +! +module foo + implicit none + real :: a + pointer(c_a, a) +end module foo + +program test + use foo + real :: z + c_a = loc(z) + a = 42 + if (z /= 42) call abort +end program test diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 index a5337ca3b..6134a5625 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/default_format_denormal_2.f90 @@ -1,6 +1,6 @@ ! { dg-require-effective-target fortran_large_real } -! { dg-do run { xfail powerpc*-apple-darwin* powerpc*-*-linux* } } -! Test XFAILed on these platforms because the system's printf() lacks +! { dg-do run { xfail powerpc*-apple-darwin* } } +! Test XFAILed on this platform because the system's printf() lacks ! proper support for denormalized long doubles. See PR24685 ! ! This tests that the default formats for formatted I/O of reals are diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/finalize_25.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/finalize_25.f90 new file mode 100644 index 000000000..cdbec4cac --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/finalize_25.f90 @@ -0,0 +1,55 @@ +! { dg-do run } +! +! PR fortran/58880 +! PR fortran/60495 +! +! Contributed by Andrew Benson and Janus Weil +! + +module gn + implicit none + type sl + integer, allocatable, dimension(:) :: lv + contains + final :: sld + end type + type :: nde + type(sl) :: r + end type nde + + integer :: cnt = 0 + +contains + + subroutine sld(s) + type(sl) :: s + cnt = cnt + 1 + ! print *,'Finalize sl' + end subroutine + subroutine ndm(s) + type(nde), intent(inout) :: s + type(nde) :: i + i=s + end subroutine ndm +end module + +program main + use gn + type :: nde2 + type(sl) :: r + end type nde2 + type(nde) :: x + + cnt = 0 + call ndm(x) + if (cnt /= 2) call abort() + + cnt = 0 + call ndm2() + if (cnt /= 3) call abort() +contains + subroutine ndm2 + type(nde2) :: s,i + i=s + end subroutine ndm2 +end program main diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/affinity-1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/affinity-1.f90 new file mode 100644 index 000000000..b6e20b9ce --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/affinity-1.f90 @@ -0,0 +1,19 @@ + integer :: i, j + integer, dimension (10, 10) :: a +!$omp parallel do default(none)proc_bind(master)shared(a) + do i = 1, 10 + j = 4 + do j = 1, 10 + a(i, j) = i + j + end do + j = 8 + end do +!$omp end parallel do +!$omp parallel proc_bind (close) +!$omp parallel default(none) proc_bind (spread) firstprivate(a) private (i) + do i = 1, 10 + a(i, i) = i + enddo +!$omp end parallel +!$omp endparallel +end diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/allocatable_components_1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/allocatable_components_1.f90 index 2a762c77b..bc06cc866 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/allocatable_components_1.f90 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/allocatable_components_1.f90 @@ -14,7 +14,7 @@ CONTAINS TYPE(t), SAVE :: a !$omp threadprivate(a) - !$omp parallel copyin(a) ! { dg-error "has ALLOCATABLE components" } + !$omp parallel copyin(a) ! do something !$omp end parallel END SUBROUTINE @@ -22,7 +22,7 @@ CONTAINS SUBROUTINE test_copyprivate() TYPE(t) :: a - !$omp single ! { dg-error "has ALLOCATABLE components" } + !$omp single ! do something !$omp end single copyprivate (a) END SUBROUTINE @@ -30,7 +30,7 @@ CONTAINS SUBROUTINE test_firstprivate TYPE(t) :: a - !$omp parallel firstprivate(a) ! { dg-error "has ALLOCATABLE components" } + !$omp parallel firstprivate(a) ! do something !$omp end parallel END SUBROUTINE @@ -39,7 +39,7 @@ CONTAINS TYPE(t) :: a INTEGER :: i - !$omp parallel do lastprivate(a) ! { dg-error "has ALLOCATABLE components" } + !$omp parallel do lastprivate(a) DO i = 1, 1 END DO !$omp end parallel do @@ -49,7 +49,7 @@ CONTAINS TYPE(t) :: a(10) INTEGER :: i - !$omp parallel do reduction(+: a) ! { dg-error "must be of numeric type" } + !$omp parallel do reduction(+: a) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } DO i = 1, SIZE(a) END DO !$omp end parallel do diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.31.3.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.31.3.f90 index f67c91c21..598c90420 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.31.3.f90 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.31.3.f90 @@ -5,7 +5,7 @@ !$OMP PARALLEL DO REDUCTION(MAX: M) ! MAX is no longer the ! intrinsic so this ! is non-conforming -! { dg-error "is not INTRINSIC procedure name" "" { target *-*-* } 5 } */ +! { dg-error "OMP DECLARE REDUCTION max not found" "" { target *-*-* } 5 } */ DO I = 1, 100 CALL SUB(M,I) END DO diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/associate1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/associate1.f90 new file mode 100644 index 000000000..abc5ae95a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/associate1.f90 @@ -0,0 +1,83 @@ +! { dg-do compile } + +program associate1 + type dl + integer :: i + end type + type dt + integer :: i + real :: a(3, 3) + type(dl) :: c(3, 3) + end type + integer :: v, i, j + real :: a(3, 3) + type(dt) :: b(3) + i = 1 + j = 2 + associate(k => v, l => a(i, j), m => a(i, :)) + associate(n => b(j)%c(:, :)%i, o => a, p => b) +!$omp parallel shared (l) ! { dg-error "ASSOCIATE name" } +!$omp end parallel +!$omp parallel firstprivate (m) ! { dg-error "ASSOCIATE name" } +!$omp end parallel +!$omp parallel reduction (+: k) ! { dg-error "ASSOCIATE name" } +!$omp end parallel +!$omp parallel do firstprivate (k) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + end do +!$omp parallel do lastprivate (n) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + end do +!$omp parallel do private (o) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + end do +!$omp parallel do shared (p) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + end do +!$omp task private (k) ! { dg-error "ASSOCIATE name" } +!$omp end task +!$omp task shared (l) ! { dg-error "ASSOCIATE name" } +!$omp end task +!$omp task firstprivate (m) ! { dg-error "ASSOCIATE name" } +!$omp end task +!$omp do private (l) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + end do +!$omp do reduction (*: k) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + end do +!$omp sections private(o) ! { dg-error "ASSOCIATE name" } +!$omp section +!$omp section +!$omp end sections +!$omp parallel sections firstprivate(p) ! { dg-error "ASSOCIATE name" } +!$omp section +!$omp section +!$omp endparallelsections +!$omp parallelsections lastprivate(m) ! { dg-error "ASSOCIATE name" } +!$omp section +!$omp section +!$omp endparallelsections +!$omp sections reduction(+:k) ! { dg-error "ASSOCIATE name" } +!$omp section +!$omp section +!$omp end sections +!$omp simd private (l) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + end do + k = 1 +!$omp simd lastprivate (m) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + end do + k = 1 +!$omp simd reduction (+: k) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + end do + k = 1 +!$omp simd linear (k : 2) ! { dg-error "ASSOCIATE name" } + do i = 1, 10 + k = k + 2 + end do + end associate + end associate +end program diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/declare-simd-1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/declare-simd-1.f90 new file mode 100644 index 000000000..d6ae7c9c8 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/declare-simd-1.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } + +subroutine fn1 (x) + integer :: x +!$omp declare simd (fn1) inbranch notinbranch uniform (x) ! { dg-error "Unclassifiable OpenMP directive" } +end subroutine fn1 +subroutine fn2 (x) +!$omp declare simd (fn100) ! { dg-error "should refer to containing procedure" } +end subroutine fn2 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/depend-1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/depend-1.f90 new file mode 100644 index 000000000..bd6d26a38 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/depend-1.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } + +subroutine foo (x) + integer :: x(5, *) +!$omp parallel +!$omp single +!$omp task depend(in:x(:,5)) +!$omp end task +!$omp task depend(in:x(5,:)) ! { dg-error "Rightmost upper bound of assumed size array section|proper array section" } +!$omp end task +!$omp end single +!$omp end parallel +end diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/intentin1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/intentin1.f90 new file mode 100644 index 000000000..f2a2e98fd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/intentin1.f90 @@ -0,0 +1,16 @@ +! { dg-do compile } + +subroutine foo (x) + integer, pointer, intent (in) :: x + integer :: i +!$omp parallel private (x) ! { dg-error "INTENT.IN. POINTER" } +!$omp end parallel +!$omp parallel do lastprivate (x) ! { dg-error "INTENT.IN. POINTER" } + do i = 1, 10 + end do +!$omp simd linear (x) ! { dg-error "INTENT.IN. POINTER" } + do i = 1, 10 + end do +!$omp single ! { dg-error "INTENT.IN. POINTER" } +!$omp end single copyprivate (x) +end diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/omp_do_concurrent.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/omp_do_concurrent.f90 new file mode 100644 index 000000000..83204791d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/omp_do_concurrent.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! { dg-options "-fopenmp" } +! +! PR fortran/60127 +! +! OpenMP 4.0 doesn't permit DO CONCURRENT (yet) +! + +!$omp do +do concurrent(i=1:5) ! { dg-error "OMP DO cannot be a DO CONCURRENT loop" } +print *, 'Hello' +end do +end diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-1.f90 new file mode 100644 index 000000000..c9ce70c4f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-1.f90 @@ -0,0 +1,137 @@ +! { dg-do compile } +! { dg-options "-fno-openmp -fopenmp-simd -fdump-tree-original -O2" } + +!$omp declare reduction (foo:integer:omp_out = omp_out + omp_in) + interface + integer function foo (x, y) + integer, value :: x, y +!$omp declare simd (foo) linear (y : 2) + end function foo + end interface + integer :: i, a(64), b, c + integer, save :: d +!$omp threadprivate (d) + d = 5 + a = 6 +!$omp simd + do i = 1, 64 + a(i) = foo (a(i), 2 * i) + end do + b = 0 + c = 0 +!$omp simd reduction (+:b) reduction (foo:c) + do i = 1, 64 + b = b + a(i) + c = c + a(i) * 2 + end do + print *, b + b = 0 +!$omp parallel +!$omp do simd schedule(static, 4) safelen (8) reduction (+:b) + do i = 1, 64 + a(i) = a(i) + 1 + b = b + 1 + end do +!$omp end parallel + print *, b + b = 0 +!$omp parallel do simd schedule(static, 4) safelen (8) & +!$omp num_threads (4) if (.true.) reduction (+:b) + do i = 1, 64 + a(i) = a(i) + 1 + b = b + 1 + end do + print *, b + b = 0 +!$omp parallel +!$omp do simd schedule(static, 4) safelen (8) reduction (+:b) + do i = 1, 64 + a(i) = a(i) + 1 + b = b + 1 + end do +!$omp enddosimd +!$omp end parallel + print *, b + b = 0 +!$omp parallel do simd schedule(static, 4) safelen (8) & +!$omp num_threads (4) if (.true.) reduction (+:b) + do i = 1, 64 + a(i) = a(i) + 1 + b = b + 1 + end do +!$omp end parallel do simd +!$omp atomic seq_cst + b = b + 1 +!$omp end atomic +!$omp barrier +!$omp parallel private (i) +!$omp cancellation point parallel +!$omp critical (bar) + b = b + 1 +!$omp end critical (bar) +!$omp flush(b) +!$omp single + b = b + 1 +!$omp end single +!$omp do ordered + do i = 1, 10 + !$omp atomic + b = b + 1 + !$omp end atomic + !$omp ordered + print *, b + !$omp end ordered + end do +!$omp end do +!$omp master + b = b + 1 +!$omp end master +!$omp cancel parallel +!$omp end parallel +!$omp parallel do schedule(runtime) num_threads(8) + do i = 1, 10 + print *, b + end do +!$omp end parallel do +!$omp sections +!$omp section + b = b + 1 +!$omp section + c = c + 1 +!$omp end sections + print *, b +!$omp parallel sections firstprivate (b) if (.true.) +!$omp section + b = b + 1 +!$omp section + c = c + 1 +!$omp endparallelsections +!$omp workshare + b = 24 +!$omp end workshare +!$omp parallel workshare num_threads (2) + b = b + 1 + c = c + 1 +!$omp end parallel workshare + print *, b +!$omp parallel +!$omp single +!$omp taskgroup +!$omp task firstprivate (b) + b = b + 1 +!$omp taskyield +!$omp end task +!$omp task firstprivate (b) + b = b + 1 +!$omp end task +!$omp taskwait +!$omp end taskgroup +!$omp end single +!$omp end parallel + print *, a, c +end + +! { dg-final { scan-tree-dump-times "pragma omp simd" 6 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp" 6 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP" 0 "original" } } +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-2.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-2.f90 new file mode 100644 index 000000000..4b2046a58 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-2.f90 @@ -0,0 +1,28 @@ +! { dg-do compile } +! { dg-options "-fopenmp -fopenmp-simd -fdump-tree-original -O2" } + +include 'openmp-simd-1.f90' + +! { dg-final { scan-tree-dump-times "pragma omp simd" 6 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp" 39 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp for" 6 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp parallel" 9 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp taskgroup" 1 "original" } } +! Includes the above taskgroup +! { dg-final { scan-tree-dump-times "pragma omp task" 3 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp critical" 1 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp atomic" 2 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp sections" 2 "original" } } +! Includes the above sections +! { dg-final { scan-tree-dump-times "pragma omp section" 6 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp single" 4 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp ordered" 1 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp master" 1 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP" 5 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP_barrier" 1 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancellation_point" 1 "original" } } +! Includes the above cancellation point +! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancel" 2 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP_taskyield" 1 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP_taskwait" 1 "original" } } +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-3.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-3.f90 new file mode 100644 index 000000000..2dece895f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/openmp-simd-3.f90 @@ -0,0 +1,28 @@ +! { dg-do compile } +! { dg-options "-fopenmp -fno-openmp-simd -fdump-tree-original -O2" } + +include 'openmp-simd-1.f90' + +! { dg-final { scan-tree-dump-times "pragma omp simd" 6 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp" 39 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp for" 6 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp parallel" 9 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp taskgroup" 1 "original" } } +! Includes the above taskgroup +! { dg-final { scan-tree-dump-times "pragma omp task" 3 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp critical" 1 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp atomic" 2 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp sections" 2 "original" } } +! Includes the above sections +! { dg-final { scan-tree-dump-times "pragma omp section" 6 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp single" 4 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp ordered" 1 "original" } } +! { dg-final { scan-tree-dump-times "pragma omp master" 1 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP" 5 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP_barrier" 1 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancellation_point" 1 "original" } } +! Includes the above cancellation point +! { dg-final { scan-tree-dump-times "__builtin_GOMP_cancel" 2 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP_taskyield" 1 "original" } } +! { dg-final { scan-tree-dump-times "__builtin_GOMP_taskwait" 1 "original" } } +! { dg-final { cleanup-tree-dump "original" } } diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/proc_ptr_2.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/proc_ptr_2.f90 new file mode 100644 index 000000000..d993429a7 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/proc_ptr_2.f90 @@ -0,0 +1,14 @@ +! { dg-do compile } + procedure(foo), pointer :: ptr + integer :: i + ptr => foo +!$omp do reduction (+ : ptr) ! { dg-error "Procedure pointer|not found" } + do i = 1, 10 + end do +!$omp simd linear (ptr) ! { dg-error "must be INTEGER" } + do i = 1, 10 + end do +contains + subroutine foo + end subroutine +end diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/reduction1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/reduction1.f90 index 4912f7178..cdc530bf0 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/reduction1.f90 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/reduction1.f90 @@ -60,73 +60,73 @@ common /blk/ i1 !$omp end parallel !$omp parallel reduction (*:ia1) ! { dg-error "Assumed size" } !$omp end parallel -!$omp parallel reduction (+:l1) ! { dg-error "must be of numeric type, got LOGICAL" } +!$omp parallel reduction (+:l1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (*:la1) ! { dg-error "must be of numeric type, got LOGICAL" } +!$omp parallel reduction (*:la1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (-:a1) ! { dg-error "must be of numeric type, got CHARACTER" } +!$omp parallel reduction (-:a1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (+:t1) ! { dg-error "must be of numeric type, got TYPE" } +!$omp parallel reduction (+:t1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (*:ta1) ! { dg-error "must be of numeric type, got TYPE" } +!$omp parallel reduction (*:ta1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.and.:i3) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.and.:i3) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.or.:ia2) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.or.:ia2) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.eqv.:r1) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.eqv.:r1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.neqv.:ra1) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.neqv.:ra1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.and.:d1) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.and.:d1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.or.:da1) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.or.:da1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.eqv.:c1) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.eqv.:c1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.neqv.:ca1) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.neqv.:ca1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.and.:a1) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.and.:a1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.or.:t1) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.or.:t1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (.eqv.:ta1) ! { dg-error "must be LOGICAL" } +!$omp parallel reduction (.eqv.:ta1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (min:c1) ! { dg-error "must be INTEGER or REAL" } +!$omp parallel reduction (min:c1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (max:ca1) ! { dg-error "must be INTEGER or REAL" } +!$omp parallel reduction (max:ca1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (max:l1) ! { dg-error "must be INTEGER or REAL" } +!$omp parallel reduction (max:l1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (min:la1) ! { dg-error "must be INTEGER or REAL" } +!$omp parallel reduction (min:la1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (max:a1) ! { dg-error "must be INTEGER or REAL" } +!$omp parallel reduction (max:a1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (min:t1) ! { dg-error "must be INTEGER or REAL" } +!$omp parallel reduction (min:t1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (max:ta1) ! { dg-error "must be INTEGER or REAL" } +!$omp parallel reduction (max:ta1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (iand:r1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (iand:r1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (ior:ra1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (ior:ra1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (ieor:d1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (ieor:d1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (ior:da1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (ior:da1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (iand:c1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (iand:c1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (ior:ca1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (ior:ca1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (ieor:l1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (ieor:l1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (iand:la1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (iand:la1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (ior:a1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (ior:a1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (ieor:t1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (ieor:t1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel -!$omp parallel reduction (iand:ta1) ! { dg-error "must be INTEGER" } +!$omp parallel reduction (iand:ta1) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found for type" } !$omp end parallel end subroutine diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/reduction3.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/reduction3.f90 index 2c113893a..9cab6d57d 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/reduction3.f90 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/reduction3.f90 @@ -16,7 +16,7 @@ subroutine f1 integer :: i, ior ior = 6 i = 6 -!$omp parallel reduction (ior:i) ! { dg-error "is not INTRINSIC procedure name" } +!$omp parallel reduction (ior:i) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found" } !$omp end parallel end subroutine f1 subroutine f2 @@ -27,7 +27,7 @@ subroutine f2 end function end interface i = 6 -!$omp parallel reduction (ior:i) ! { dg-error "is not INTRINSIC procedure name" } +!$omp parallel reduction (ior:i) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found" } i = ior (i, 3) !$omp end parallel end subroutine f2 @@ -50,7 +50,7 @@ subroutine f5 use mreduction3 integer :: i i = 6 -!$omp parallel reduction (ior:i) ! { dg-error "is not INTRINSIC procedure name" } +!$omp parallel reduction (ior:i) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found" } i = ior (i, 7) !$omp end parallel end subroutine f5 @@ -58,7 +58,7 @@ subroutine f6 use mreduction3 integer :: i i = 6 -!$omp parallel reduction (iand:i) ! { dg-error "is not INTRINSIC procedure name" } +!$omp parallel reduction (iand:i) ! { dg-error "OMP DECLARE REDUCTION\[^\n\r\]*not found" } i = iand (i, 18) !$omp end parallel end subroutine f6 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target1.f90 new file mode 100644 index 000000000..14db4970b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target1.f90 @@ -0,0 +1,520 @@ +! { dg-do compile } +! { dg-options "-fopenmp" } + +module target1 + interface + subroutine dosomething (a, n, m) + integer :: a (:), n, m + !$omp declare target + end subroutine dosomething + end interface +contains + subroutine foo (n, o, p, q, r, pp) + integer :: n, o, p, q, r, s, i, j + integer :: a (2:o) + integer, pointer :: pp + !$omp target data device (n + 1) if (n .ne. 6) map (tofrom: n, r) + !$omp target device (n + 1) if (n .ne. 6) map (from: n) map (alloc: a(2:o)) + call dosomething (a, n, 0) + !$omp end target + !$omp target teams device (n + 1) num_teams (n + 4) thread_limit (n * 2) & + !$omp & if (n .ne. 6)map (from: n) map (alloc: a(2:o)) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) + r = r + 1 + p = q + call dosomething (a, n, p + q) + !$omp end target teams + !$omp target teams distribute device (n + 1) num_teams (n + 4) collapse (2) & + !$omp & if (n .ne. 6)map (from: n) map (alloc: a(2:o)) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + end do + !$omp target teams distribute device (n + 1) num_teams (n + 4) & + !$omp & if (n .ne. 6)map (from: n) map (alloc: a(2:o)) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + end do + !$omp end target teams distribute + !$omp target teams distribute parallel do device (n + 1) num_teams (n + 4) & + !$omp & if (n .ne. 6)map (from: n) map (alloc: a(2:o)) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) collapse (2) & + !$omp & num_threads (n + 4) proc_bind (spread) lastprivate (s) & + !$omp & ordered schedule (static, 8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + !$omp ordered + p = q + !$omp end ordered + s = i * 10 + j + end do + end do + !$omp target teams distribute parallel do device (n + 1) num_teams (n + 4) & + !$omp & if (n .ne. 6)map (from: n) map (alloc: a(2:o)) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) & + !$omp & proc_bind (master) lastprivate (s) ordered schedule (static, 8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + !$omp ordered + p = q + !$omp end ordered + s = i * 10 + end do + !$omp end target teams distribute parallel do + !$omp target teams distribute parallel do simd device (n + 1) & + !$omp & if (n .ne. 6)map (from: n) map (alloc: a(2:o)) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) collapse (2) & + !$omp & num_threads (n + 4) proc_bind (spread) lastprivate (s) & + !$omp & schedule (static, 8) num_teams (n + 4) safelen(8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + a(2+i*10+j) = p + q + s = i * 10 + j + end do + end do + !$omp target teams distribute parallel do simd device (n + 1) & + !$omp & if (n .ne. 6)map (from: n) map (alloc: a(2:o)) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) & + !$omp & proc_bind (master) lastprivate (s) schedule (static, 8) & + !$omp & num_teams (n + 4) safelen(16) linear(i:1) aligned (pp:4) + do i = 1, 10 + r = r + 1 + p = q + a(1+i) = p + q + s = i * 10 + end do + !$omp end target teams distribute parallel do simd + !$omp target teams distribute simd device (n + 1) & + !$omp & if (n .ne. 6)map (from: n) map (alloc: a(2:o)) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) collapse (2) & + !$omp & lastprivate (s) num_teams (n + 4) safelen(8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + a(2+i*10+j) = p + q + s = i * 10 + j + end do + end do + !$omp target teams distribute simd device (n + 1) & + !$omp & if (n .ne. 6)map (from: n) map (alloc: a(2:o)) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) lastprivate (s) & + !$omp & num_teams (n + 4) safelen(16) linear(i:1) aligned (pp:4) + do i = 1, 10 + r = r + 1 + p = q + a(1+i) = p + q + s = i * 10 + end do + !$omp end target teams distribute simd + !$omp target device (n + 1) if (n .ne. 6)map (from: n) map (alloc: a(2:o)) + !$omp teams num_teams (n + 4) thread_limit (n * 2) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) + r = r + 1 + p = q + call dosomething (a, n, p + q) + !$omp end teams + !$omp end target + !$omp target device (n + 1) if (n .ne. 6)map (from: n) map (alloc: a(2:o)) + !$omp teams distribute num_teams (n + 4) collapse (2) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + end do + !$omp end target + !$omp target device (n + 1) if (n .ne. 6)map (from: n) map (alloc: a(2:o)) + !$omp teams distribute num_teams (n + 4) default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + end do + !$omp end teams distribute + !$omp end target + !$omp target device (n + 1) if (n .ne. 6)map (from: n) map (alloc: a(2:o)) + !$omp teams distribute parallel do num_teams (n + 4) & + !$omp & if (n .ne. 6) default(shared) ordered schedule (static, 8) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) collapse (2) & + !$omp & num_threads (n + 4) proc_bind (spread) lastprivate (s) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + !$omp ordered + p = q + !$omp end ordered + s = i * 10 + j + end do + end do + !$omp end target + !$omp target device (n + 1) if (n .ne. 6)map (from: n) map (alloc: a(2:o)) + !$omp teams distribute parallel do num_teams (n + 4)if(n.ne.6)default(shared)& + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) & + !$omp & proc_bind (master) lastprivate (s) ordered schedule (static, 8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + !$omp ordered + p = q + !$omp end ordered + s = i * 10 + end do + !$omp end teams distribute parallel do + !$omp end target + !$omp target device (n + 1) if (n .ne. 6)map (from: n) map (alloc: a(2:o)) + !$omp teams distribute parallel do simd if(n.ne.6)default(shared)& + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) collapse (2) & + !$omp & num_threads (n + 4) proc_bind (spread) lastprivate (s) & + !$omp & schedule (static, 8) num_teams (n + 4) safelen(8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + a(2+i*10+j) = p + q + s = i * 10 + j + end do + end do + !$omp end target + !$omp target device (n + 1) if (n .ne. 6)map (from: n) map (alloc: a(2:o)) + !$omp teams distribute parallel do simd if (n .ne. 6)default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) num_threads (n + 4) & + !$omp & proc_bind (master) lastprivate (s) schedule (static, 8) & + !$omp & num_teams (n + 4) safelen(16) linear(i:1) aligned (pp:4) + do i = 1, 10 + r = r + 1 + p = q + a(1+i) = p + q + s = i * 10 + end do + !$omp end teams distribute parallel do simd + !$omp end target + !$omp target device (n + 1) if (n .ne. 6)map (from: n) map (alloc: a(2:o)) + !$omp teams distribute simd default(shared) safelen(8) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) collapse (2) & + !$omp & lastprivate (s) num_teams (n + 4) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + a(2+i*10+j) = p + q + s = i * 10 + j + end do + end do + !$omp end target + !$omp target device (n + 1) if (n .ne. 6)map (from: n) map (alloc: a(2:o)) + !$omp teams distribute simd default(shared) aligned (pp:4) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & thread_limit (n * 2) dist_schedule (static, 4) lastprivate (s) + do i = 1, 10 + r = r + 1 + p = q + a(1+i) = p + q + s = i * 10 + end do + !$omp end teams distribute simd + !$omp end target + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction ( + : r ) + !$omp distribute collapse (2) firstprivate (q) dist_schedule (static, 4) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + end do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute firstprivate (q) dist_schedule (static, 4) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + end do + !$omp end distribute + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute parallel do if (n .ne. 6) default(shared) & + !$omp & ordered schedule (static, 8) private (p) firstprivate (q) & + !$omp & shared(n)reduction(+:r)dist_schedule(static,4)collapse(2)& + !$omp & num_threads (n + 4) proc_bind (spread) lastprivate (s) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + !$omp ordered + p = q + !$omp end ordered + s = i * 10 + j + end do + end do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute parallel do if(n.ne.6)default(shared)& + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & dist_schedule (static, 4) num_threads (n + 4) & + !$omp & proc_bind (master) lastprivate (s) ordered schedule (static, 8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + !$omp ordered + p = q + !$omp end ordered + s = i * 10 + end do + !$omp end distribute parallel do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute parallel do simd if(n.ne.6)default(shared)& + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & dist_schedule (static, 4) collapse (2) safelen(8) & + !$omp & num_threads (n + 4) proc_bind (spread) lastprivate (s) & + !$omp & schedule (static, 8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + a(2+i*10+j) = p + q + s = i * 10 + j + end do + end do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute parallel do simd if (n .ne. 6)default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & dist_schedule (static, 4) num_threads (n + 4) & + !$omp & proc_bind (master) lastprivate (s) schedule (static, 8) & + !$omp & safelen(16) linear(i:1) aligned (pp:4) + do i = 1, 10 + r = r + 1 + p = q + a(1+i) = p + q + s = i * 10 + end do + !$omp end distribute parallel do simd + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute simd safelen(8) lastprivate(s) & + !$omp & private (p) firstprivate (q) reduction (+: r) & + !$omp & dist_schedule (static, 4) collapse (2) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + a(2+i*10+j) = p + q + s = i * 10 + j + end do + end do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute simd aligned (pp:4) & + !$omp & private (p) firstprivate (q) reduction (+: r) & + !$omp & dist_schedule (static, 4) lastprivate (s) + do i = 1, 10 + r = r + 1 + p = q + a(1+i) = p + q + s = i * 10 + end do + !$omp end distribute simd + !$omp end target teams + !$omp end target data + end subroutine + subroutine bar (n, o, p, r, pp) + integer :: n, o, p, q, r, s, i, j + integer :: a (2:o) + integer, pointer :: pp + common /blk/ i, j, q + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction ( + : r ) + !$omp distribute collapse (2) firstprivate (q) dist_schedule (static, 4) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + end do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute firstprivate (q) dist_schedule (static, 4) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + end do + !$omp end distribute + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute parallel do if (n .ne. 6) default(shared) & + !$omp & ordered schedule (static, 8) private (p) firstprivate (q) & + !$omp & shared(n)reduction(+:r)dist_schedule(static,4)collapse(2)& + !$omp & num_threads (n + 4) proc_bind (spread) lastprivate (s) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + !$omp ordered + p = q + !$omp end ordered + s = i * 10 + j + end do + end do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute parallel do if(n.ne.6)default(shared)& + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & dist_schedule (static, 4) num_threads (n + 4) & + !$omp & proc_bind (master) lastprivate (s) ordered schedule (static, 8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + call dosomething (a, n, p + q) + end do + !$omp ordered + p = q + !$omp end ordered + s = i * 10 + end do + !$omp end distribute parallel do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute parallel do simd if(n.ne.6)default(shared)& + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & dist_schedule (static, 4) collapse (2) safelen(8) & + !$omp & num_threads (n + 4) proc_bind (spread) lastprivate (s) & + !$omp & schedule (static, 8) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + a(2+i*10+j) = p + q + s = i * 10 + j + end do + end do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute parallel do simd if (n .ne. 6)default(shared) & + !$omp & private (p) firstprivate (q) shared (n) reduction (+: r) & + !$omp & dist_schedule (static, 4) num_threads (n + 4) & + !$omp & proc_bind (master) lastprivate (s) schedule (static, 8) & + !$omp & safelen(16) linear(i:1) aligned (pp:4) + do i = 1, 10 + r = r + 1 + p = q + a(1+i) = p + q + s = i * 10 + end do + !$omp end distribute parallel do simd + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute simd safelen(8) lastprivate(s) & + !$omp & private (p) firstprivate (q) reduction (+: r) & + !$omp & dist_schedule (static, 4) collapse (2) + do i = 1, 10 + do j = 1, 10 + r = r + 1 + p = q + a(2+i*10+j) = p + q + s = i * 10 + j + end do + end do + !$omp end target teams + !$omp target teams device (n + 1) if (n .ne. 6)map (from: n) & + !$omp & map (alloc: a(2:o)) num_teams (n + 4) thread_limit (n * 2) & + !$omp & default(shared) shared(n) private (p) reduction(+:r) + !$omp distribute simd aligned (pp:4) & + !$omp & private (p) firstprivate (q) reduction (+: r) & + !$omp & dist_schedule (static, 4) lastprivate (s) + do i = 1, 10 + r = r + 1 + p = q + a(1+i) = p + q + s = i * 10 + end do + !$omp end distribute simd + !$omp end target teams + end subroutine +end module diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target2.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target2.f90 new file mode 100644 index 000000000..7521331fc --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target2.f90 @@ -0,0 +1,74 @@ +! { dg-do compile } +! { dg-options "-fopenmp -ffree-line-length-160" } + +subroutine foo (n, s, t, u, v, w) + integer :: n, i, s, t, u, v, w + common /bar/ i + !$omp simd safelen(s + 1) + do i = 1, n + end do + !$omp do schedule (static, t * 2) + do i = 1, n + end do + !$omp do simd safelen(s + 1) schedule (static, t * 2) + do i = 1, n + end do + !$omp parallel do schedule (static, t * 2) num_threads (u - 1) + do i = 1, n + end do + !$omp parallel do simd safelen(s + 1) schedule (static, t * 2) num_threads (u - 1) + do i = 1, n + end do + !$omp distribute dist_schedule (static, v + 8) + do i = 1, n + end do + !$omp distribute simd dist_schedule (static, v + 8) safelen(s + 1) + do i = 1, n + end do + !$omp distribute parallel do simd dist_schedule (static, v + 8) safelen(s + 1) & + !$omp & schedule (static, t * 2) num_threads (u - 1) + do i = 1, n + end do + !$omp distribute parallel do dist_schedule (static, v + 8) num_threads (u - 1) & + !$omp & schedule (static, t * 2) + do i = 1, n + end do + !$omp target + !$omp teams distribute dist_schedule (static, v + 8) num_teams (w + 8) + do i = 1, n + end do + !$omp end target + !$omp target + !$omp teams distribute simd dist_schedule (static, v + 8) safelen(s + 1) & + !$omp & num_teams (w + 8) + do i = 1, n + end do + !$omp end target + !$omp target + !$omp teams distribute parallel do simd dist_schedule (static, v + 8) safelen(s + 1) & + !$omp & schedule (static, t * 2) num_threads (u - 1) num_teams (w + 8) + do i = 1, n + end do + !$omp end target + !$omp target + !$omp teams distribute parallel do dist_schedule (static, v + 8) num_threads (u - 1) & + !$omp & schedule (static, t * 2) num_teams (w + 8) + do i = 1, n + end do + !$omp end target + !$omp target teams distribute dist_schedule (static, v + 8) num_teams (w + 8) + do i = 1, n + end do + !$omp target teams distribute simd dist_schedule (static, v + 8) safelen(s + 1) & + !$omp & num_teams (w + 8) + do i = 1, n + end do + !$omp target teams distribute parallel do simd dist_schedule (static, v + 8) safelen(s + 1) & + !$omp & schedule (static, t * 2) num_threads (u - 1) num_teams (w + 8) + do i = 1, n + end do + !$omp target teams distribute parallel do dist_schedule (static, v + 8) num_threads (u - 1) & + !$omp & schedule (static, t * 2) num_teams (w + 8) + do i = 1, n + end do +end subroutine diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target3.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target3.f90 new file mode 100644 index 000000000..53a9682bf --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/target3.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! { dg-options "-fopenmp" } + +subroutine foo (r) + integer :: i, r + !$omp target + !$omp target teams distribute parallel do reduction (+: r) ! { dg-warning "target construct inside of target region" } + do i = 1, 10 + r = r + 1 + end do + !$omp end target +end subroutine diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr1.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr1.f90 new file mode 100644 index 000000000..84601310c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr1.f90 @@ -0,0 +1,41 @@ +! { dg-do compile } + +subroutine f1 +!$omp declare reduction (.le.:integer:omp_out = omp_out + omp_in) ! { dg-error "Invalid operator for" } +end subroutine f1 +subroutine f2 +!$omp declare reduction (bar:real(kind=4):omp_out = omp_out + omp_in) + real(kind=4) :: r + integer :: i + r = 0.0 +!$omp parallel do reduction (bar:r) + do i = 1, 10 + r = r + i + end do +!$omp parallel do reduction (foo:r) ! { dg-error "foo not found" } + do i = 1, 10 + r = r + i + end do +!$omp parallel do reduction (.gt.:r) ! { dg-error "cannot be used as a defined operator" } + do i = 1, 10 + r = r + i + end do +end subroutine f2 +subroutine f3 +!$omp declare reduction (foo:blah:omp_out=omp_out + omp_in) ! { dg-error "Unclassifiable OpenMP directive" } +end subroutine f3 +subroutine f4 +!$omp declare reduction (foo:integer:a => null()) ! { dg-error "Invalid character in name" } +!$omp declare reduction (foo:integer:omp_out = omp_in + omp_out) & +!$omp & initializer(a => null()) ! { dg-error "Invalid character in name" } +end subroutine f4 +subroutine f5 + integer :: a, b +!$omp declare reduction (foo:integer:a = b + 1) ! { dg-error "Variable other than OMP_OUT or OMP_IN used in combiner" } +!$omp declare reduction (bar:integer:omp_out = omp_out * omp_in) & +!$omp & initializer(b = a + 1) ! { dg-error "Variable other than OMP_PRIV or OMP_ORIG used in INITIALIZER clause" } +end subroutine f5 +subroutine f6 +!$omp declare reduction (foo:integer:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_orig=omp_priv) +end subroutine f6 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr2.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr2.f90 new file mode 100644 index 000000000..7038d1869 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr2.f90 @@ -0,0 +1,53 @@ +! { dg-do compile } + +subroutine f6 +!$omp declare reduction (foo:real:omp_out (omp_in)) ! { dg-error "Unclassifiable OpenMP directive" } +!$omp declare reduction (bar:real:omp_out = omp_in * omp_out) & ! { dg-error "Unclassifiable OpenMP directive" } +!$omp & initializer (omp_priv (omp_orig)) +end subroutine f6 +subroutine f7 + integer :: a +!$omp declare reduction (foo:integer:a (omp_out, omp_in)) ! { dg-error "Unclassifiable OpenMP directive" } +!$omp declare reduction (bar:real:omp_out = omp_out.or.omp_in) ! { dg-error "Operands of logical operator" } +!$omp declare reduction (baz:real:omp_out = omp_out + omp_in) +!$omp & initializer (a (omp_priv, omp_orig)) ! { dg-error "Unclassifiable OpenMP directive" } + real :: r + r = 0.0 +!$omp parallel reduction (bar:r) +!$omp end parallel +end subroutine f7 +subroutine f8 + interface + subroutine f8a (x) + integer :: x + end subroutine f8a + end interface +!$omp declare reduction (baz:integer:omp_out = omp_out + omp_in) & +!$omp & initializer (f8a (omp_orig)) ! { dg-error "One of actual subroutine arguments in INITIALIZER clause" } +!$omp declare reduction (foo:integer:f8a) ! { dg-error "is not a variable" } +!$omp declare reduction (bar:integer:omp_out = omp_out - omp_in) & +!$omp & initializer (f8a) ! { dg-error "is not a variable" } +end subroutine f8 +subroutine f9 + type dt ! { dg-error "which is not consistent with the CALL" } + integer :: x = 0 + integer :: y = 0 + end type dt + integer :: i +!$omp declare reduction (foo:integer:dt (omp_out, omp_in)) ! { dg-error "which is not consistent with the CALL" } +!$omp declare reduction (bar:integer:omp_out = omp_out + omp_in) & +!$omp & initializer (dt (omp_priv, omp_orig)) ! { dg-error "which is not consistent with the CALL" } + i = 0 +!$omp parallel reduction (foo : i) +!$omp end parallel +!$omp parallel reduction (bar : i) +!$omp end parallel +end subroutine f9 +subroutine f10 + integer :: a, b +!$omp declare reduction(foo:character(len=64) & +!$omp & :omp_out(a:b) = omp_in(a:b)) ! { dg-error "Variable other than OMP_OUT or OMP_IN used in combiner" } +!$omp declare reduction(bar:character(len=16) & +!$omp & :omp_out = trim(omp_out) // omp_in) & +!$omp & initializer (omp_priv(a:b) = ' ') ! { dg-error "Variable other than OMP_PRIV or OMP_ORIG used in INITIALIZER clause" } +end subroutine f10 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr3.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr3.f90 new file mode 100644 index 000000000..a4feaddd1 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr3.f90 @@ -0,0 +1,75 @@ +! { dg-do compile } + +subroutine f1 + type dt + logical :: l = .false. + end type + type dt2 + logical :: l = .false. + end type +!$omp declare reduction (foo:integer(kind = 4) & ! { dg-error "Previous !.OMP DECLARE REDUCTION" } +!$omp & :omp_out = omp_out + omp_in) +!$omp declare reduction (foo:integer(kind = 4) : & ! { dg-error "Redefinition of !.OMP DECLARE REDUCTION" } +!$omp & omp_out = omp_out + omp_in) +!$omp declare reduction (bar:integer, & +!$omp & real:omp_out = omp_out + omp_in) +!$omp declare reduction (baz:integer,real,integer & ! { dg-error "Redefinition of !.OMP DECLARE REDUCTION|Previous" } +!$omp & : omp_out = omp_out + omp_in) +!$omp declare reduction (id1:dt,dt2:omp_out%l=omp_out%l & +!$omp & .or.omp_in%l) +!$omp declare reduction (id2:dt,dt:omp_out%l=omp_out%l & ! { dg-error "Redefinition of !.OMP DECLARE REDUCTION|Previous" } +!$omp & .or.omp_in%l) +!$omp declare reduction (id3:dt2,dt:omp_out%l=omp_out%l & ! { dg-error "Previous !.OMP DECLARE REDUCTION" } +!$omp & .or.omp_in%l) +!$omp declare reduction (id3:dt2:omp_out%l=omp_out%l & ! { dg-error "Redefinition of !.OMP DECLARE REDUCTION" } +!$omp & .or.omp_in%l) +end subroutine f1 +subroutine f2 + interface + subroutine f2a (x, y, z) + character (len = *) :: x, y + logical :: z + end subroutine + end interface + interface f2b + subroutine f2b (x, y, z) + character (len = *, kind = 1) :: x, y + logical :: z + end subroutine + subroutine f2c (x, y, z) + character (kind = 4, len = *) :: x, y + logical :: z + end subroutine + end interface +!$omp declare reduction (foo:character(len=*): & +!$omp & f2a (omp_out, omp_in, .false.)) & +!$omp & initializer (f2a (omp_priv, omp_orig, .true.)) +!$omp declare reduction (bar:character(len=:): & +!$omp & f2a (omp_out, omp_in, .false.)) & +!$omp & initializer (f2a (omp_priv, omp_orig, .true.)) +!$omp declare reduction (baz:character(len=4): & +!$omp & f2a (omp_out, omp_in, .false.)) & +!$omp & initializer (f2a (omp_priv, omp_orig, .true.)) +!$omp declare reduction (baz:character(len=5): & +!$omp & f2a (omp_out, omp_in, .false.)) & +!$omp & initializer (f2a (omp_priv, omp_orig, .true.)) +!$omp declare reduction (baz:character(len=6): & +!$omp & f2a (omp_out, omp_in, .false.)) & +!$omp & initializer (f2a (omp_priv, omp_orig, .true.)) +!$omp declare reduction (id:character(len=*): & ! { dg-error "Previous !.OMP DECLARE REDUCTION" } +!$omp & f2a (omp_out, omp_in, .false.)) & +!$omp & initializer (f2a (omp_priv, omp_orig, .true.)) +!$omp declare reduction (id: & ! { dg-error "Redefinition of !.OMP DECLARE REDUCTION" } +!$omp & character(len=:) : f2a (omp_out, omp_in, .false.)) & +!$omp & initializer (f2a (omp_priv, omp_orig, .true.)) +!$omp declare reduction & ! { dg-error "Redefinition of !.OMP DECLARE REDUCTION|Previous" } +!$omp (id2:character(len=*), character(len=:): & +!$omp f2a (omp_out, omp_in, .false.)) & +!$omp & initializer (f2a (omp_priv, omp_orig, .true.)) +!$omp declare reduction (id3:character(len=*, kind = 1), character(kind=4, len=:): & +!$omp f2b (omp_out, omp_in, .false.)) & +!$omp & initializer (f2b (omp_priv, omp_orig, .true.)) +!$omp declare reduction (id4:character(kind=4, len=4), character(kind =1, len=4): & +!$omp f2b (omp_out, omp_in, .false.)) & +!$omp & initializer (f2b (omp_priv, omp_orig, .true.)) +end subroutine f2 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr4.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr4.f90 new file mode 100644 index 000000000..b48c1090f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr4.f90 @@ -0,0 +1,74 @@ +! { dg-do compile } + +subroutine f3 +!$omp declare reduction ! { dg-error "Unclassifiable OpenMP directive" } +!$omp declare reduction foo ! { dg-error "Unclassifiable OpenMP directive" } +!$omp declare reduction (foo) ! { dg-error "Unclassifiable OpenMP directive" } +!$omp declare reduction (foo:integer) ! { dg-error "Unclassifiable OpenMP directive" } +!$omp declare reduction (foo:integer:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_priv=0) initializer(omp_priv=0) ! { dg-error "Unexpected junk after" } +end subroutine f3 +subroutine f4 + implicit integer (o) + implicit real (b) +!$omp declare reduction (foo:integer:omp_priv(omp_out,omp_in)) ! { dg-error "Implicitly declared subroutine omp_priv" } +!$omp declare reduction (foo:real:bar(omp_out,omp_in)) ! { dg-error "Implicitly declared subroutine bar used" } +!$omp declare reduction (bar:integer:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_out (omp_priv)) ! { dg-error "Implicitly declared subroutine omp_out used" } +!$omp declare reduction (bar:real:omp_out=omp_out+omp_in) & +!$omp & initializer(bar (omp_priv, omp_orig)) ! { dg-error "Implicitly declared subroutine bar used" } +!$omp declare reduction (id1:integer:omp_out=omp_orig(omp_out,omp_in)) ! { dg-error "Implicitly declared function omp_orig used" } +!$omp declare reduction (id1:real:omp_out=foo(omp_out,omp_in)) ! { dg-error "Implicitly declared function foo used" } +!$omp declare reduction (id2:integer:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_priv = omp_in (omp_orig)) ! { dg-error "Implicitly declared function omp_in used" } +!$omp declare reduction (id2:real:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_priv = baz (omp_orig)) ! { dg-error "Implicitly declared function baz used" } + integer :: i + real :: r + i = 0 + r = 0 +!$omp parallel reduction (foo: i, r) +!$omp end parallel +!$omp parallel reduction (bar: i, r) +!$omp end parallel +!$omp parallel reduction (id1: i, r) +!$omp end parallel +!$omp parallel reduction (id2: i, r) +!$omp end parallel +end subroutine f4 +subroutine f5 + interface + subroutine f5a (x, *, y) + double precision :: x, y + end subroutine f5a + end interface +!$omp declare reduction (foo:double precision: & ! { dg-error "Subroutine call with alternate returns in combiner" } +!$omp & f5a (omp_out, *10, omp_in)) +!$omp declare reduction (bar:double precision: & +!$omp omp_out = omp_in + omp_out) & +!$omp & initializer (f5a (omp_priv, *20, omp_orig)) ! { dg-error "Subroutine call with alternate returns in INITIALIZER clause" } +10 continue +20 continue +end subroutine f5 +subroutine f6 + integer :: a +!$omp declare reduction(foo:character(len=a*2) & ! { dg-error "cannot appear in the expression|not constant" } +!$omp & :omp_out=trim(omp_out)//omp_in) & +!$omp & initializer(omp_priv=' ') +end subroutine f6 +subroutine f7 + type dt1 + integer :: a = 1 + integer :: b + end type + type dt2 + integer :: a = 2 + integer :: b = 3 + end type + type dt3 + integer :: a + integer :: b + end type dt3 +!$omp declare reduction(foo:dt1,dt2:omp_out%a=omp_out%a+omp_in%a) +!$omp declare reduction(foo:dt3:omp_out%a=omp_out%a+omp_in%a) ! { dg-error "Missing INITIALIZER clause for !.OMP DECLARE REDUCTION of derived type without default initializer" } +end subroutine f7 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr5.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr5.f90 new file mode 100644 index 000000000..aebeee3a2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr5.f90 @@ -0,0 +1,59 @@ +! { dg-do compile } + +module udr5m1 + type dt + real :: r + end type dt +end module udr5m1 +module udr5m2 + use udr5m1 + interface operator(+) + module procedure addm2 + end interface +!$omp declare reduction(+:dt:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) +!$omp declare reduction(.myadd.:dt:omp_out=omp_out.myadd.omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) + interface operator(.myadd.) + module procedure addm2 + end interface +contains + type(dt) function addm2 (x, y) + type(dt), intent (in):: x, y + addm2%r = x%r + y%r + end function +end module udr5m2 +module udr5m3 + use udr5m1 + interface operator(.myadd.) + module procedure addm3 + end interface +!$omp declare reduction(+:dt:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) +!$omp declare reduction(.myadd.:dt:omp_out=omp_out.myadd.omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) + interface operator(+) + module procedure addm3 + end interface +contains + type(dt) function addm3 (x, y) + type(dt), intent (in):: x, y + addm3%r = x%r + y%r + end function +end module udr5m3 +subroutine f1 + use udr5m2 + type(dt) :: d, e + integer :: i + d=dt(0.0) + e = dt (0.0) +!$omp parallel do reduction (+ : d) reduction ( .myadd. : e) + do i=1,100 + d=d+dt(i) + e=e+dt(i) + end do +end subroutine f1 +subroutine f2 + use udr5m3 ! { dg-error "Previous !.OMP DECLARE REDUCTION|Ambiguous interfaces" } + use udr5m2 ! { dg-error "Ambiguous !.OMP DECLARE REDUCTION" } +end subroutine f2 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr6.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr6.f90 new file mode 100644 index 000000000..92fc5bb1b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr6.f90 @@ -0,0 +1,205 @@ +! { dg-do compile } +! { dg-options "-fmax-errors=1000 -fopenmp -ffree-line-length-160" } + +module udr6 + type dt + integer :: i + end type +end module udr6 +subroutine f1 + use udr6, only : dt +!$omp declare reduction (+:integer:omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (+:real(kind=4):omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (+:double precision:omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (+:integer(kind=8),integer(kind=1) & ! { dg-error "Redefinition of predefined" } +!$omp & :omp_out = omp_out + omp_in) +!$omp declare reduction (+:complex:omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (+:complex(kind=8):omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } + interface operator(+) + function addf1 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: addf1 + end function + end interface +end subroutine f1 +subroutine f2 + use udr6, only : dt + interface operator(-) + function subf2 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: subf2 + end function + end interface +!$omp declare reduction (-:integer:omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (-:real(kind=4):omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (-:double precision:omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (-:integer(kind=8),integer(kind=1) & ! { dg-error "Redefinition of predefined" } +!$omp & :omp_out = omp_out + omp_in) +!$omp declare reduction (-:complex:omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (-:complex(kind=8):omp_out = omp_out + omp_in) ! { dg-error "Redefinition of predefined" } +end subroutine f2 +subroutine f3 + use udr6, only : dt + interface operator(*) + function mulf3 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: mulf3 + end function + end interface +!$omp declare reduction (*:integer:omp_out = omp_out * omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (*:real(kind=4):omp_out = omp_out * omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (*:double precision:omp_out = omp_out * omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (*:integer(kind=8),integer(kind=1) & ! { dg-error "Redefinition of predefined" } +!$omp & :omp_out = omp_out * omp_in) +!$omp declare reduction (*:complex:omp_out = omp_out * omp_in) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (*:complex(kind=8):omp_out = omp_out * omp_in) ! { dg-error "Redefinition of predefined" } +end subroutine f3 +subroutine f4 + use udr6, only : dt + interface operator(.and.) + function andf4 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: andf4 + end function + end interface +!$omp declare reduction (.neqv.:logical:omp_out = omp_out .or. omp_in) ! { dg-error "Redefinition of predefined" } + interface operator(.or.) + function orf4 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: orf4 + end function + end interface +!$omp declare reduction (.eqv.:logical:omp_out = omp_out .or. omp_in) ! { dg-error "Redefinition of predefined" } + interface operator(.eqv.) + function eqvf4 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: eqvf4 + end function + end interface +!$omp declare reduction (.or.:logical:omp_out = omp_out .or. omp_in) ! { dg-error "Redefinition of predefined" } + interface operator(.neqv.) + function neqvf4 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: neqvf4 + end function + end interface +!$omp declare reduction (.and.:logical:omp_out = omp_out .and. omp_in) ! { dg-error "Redefinition of predefined" } +end subroutine f4 +subroutine f5 + use udr6, only : dt + interface operator(.and.) + function andf5 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: andf5 + end function + end interface +!$omp declare reduction (.neqv.:logical(kind =4):omp_out = omp_out .neqv. omp_in) ! { dg-error "Redefinition of predefined" } + interface operator(.or.) + function orf5 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: orf5 + end function + end interface +!$omp declare reduction (.eqv.:logical(kind= 4):omp_out = omp_out .eqv. omp_in) ! { dg-error "Redefinition of predefined" } + interface operator(.eqv.) + function eqvf5 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: eqvf5 + end function + end interface +!$omp declare reduction (.or.:logical(kind=4):omp_out = omp_out .or. omp_in) ! { dg-error "Redefinition of predefined" } + interface operator(.neqv.) + function neqvf5 (x, y) + use udr6, only : dt + type(dt), intent (in) :: x, y + type(dt) :: neqvf5 + end function + end interface +!$omp declare reduction (.and.:logical(kind = 4):omp_out = omp_out .and. omp_in) ! { dg-error "Redefinition of predefined" } +end subroutine f5 +subroutine f6 +!$omp declare reduction (min:integer:omp_out = min (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (max:integer:omp_out = max (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (iand:integer:omp_out = iand (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (ior:integer:omp_out = ior (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (ieor:integer:omp_out = ieor (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (min:real:omp_out = min (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (max:real:omp_out = max (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (min:double precision:omp_out = min (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (max:double precision:omp_out = max (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +end subroutine f6 +subroutine f7 +!$omp declare reduction (min:integer(kind=2):omp_out = min (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (max:integer(kind=4):omp_out = max (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (iand:integer(kind=1):omp_out = iand (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (ior:integer(kind=8):omp_out = ior (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (ieor:integer(kind=4):omp_out = ieor (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (min:real(kind=4):omp_out = min (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (max:real(kind=4):omp_out = max (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (min:double precision:omp_out = min (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +!$omp declare reduction (max:double precision:omp_out = max (omp_out, omp_in)) ! { dg-error "Redefinition of predefined" } +end subroutine f7 +subroutine f8 + integer :: min +!$omp declare reduction (min:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (min:real:omp_out = omp_out + omp_in) +!$omp declare reduction (min:double precision:omp_out = omp_out + omp_in) +end subroutine f8 +subroutine f9 + integer :: max +!$omp declare reduction (max:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (max:real:omp_out = omp_out + omp_in) +!$omp declare reduction (max:double precision:omp_out = omp_out + omp_in) +end subroutine f9 +subroutine f10 + integer :: iand +!$omp declare reduction (iand:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (iand:real:omp_out = omp_out + omp_in) +end subroutine f10 +subroutine f11 + integer :: ior +!$omp declare reduction (ior:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (ior:real:omp_out = omp_out + omp_in) +end subroutine f11 +subroutine f12 + integer :: ieor +!$omp declare reduction (ieor:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (ieor:real:omp_out = omp_out + omp_in) +end subroutine f12 +subroutine f13 +!$omp declare reduction (min:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (min:real:omp_out = omp_out + omp_in) +!$omp declare reduction (min:double precision:omp_out = omp_out + omp_in) + integer :: min +end subroutine f13 +subroutine f14 +!$omp declare reduction (max:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (max:real:omp_out = omp_out + omp_in) +!$omp declare reduction (max:double precision:omp_out = omp_out + omp_in) + integer :: max +end subroutine f14 +subroutine f15 +!$omp declare reduction (iand:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (iand:real:omp_out = omp_out + omp_in) + integer :: iand +end subroutine f15 +subroutine f16 +!$omp declare reduction (ior:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (ior:real:omp_out = omp_out + omp_in) + integer :: ior +end subroutine f16 +subroutine f17 +!$omp declare reduction (ieor:integer:omp_out = omp_out + omp_in) +!$omp declare reduction (ieor:real:omp_out = omp_out + omp_in) + integer :: ieor +end subroutine f17 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr7.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr7.f90 new file mode 100644 index 000000000..230a3fc44 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr7.f90 @@ -0,0 +1,90 @@ +! { dg-do compile } + +module udr7m1 + type dt + real :: r + end type dt +end module udr7m1 +module udr7m2 + use udr7m1 + interface operator(+) + module procedure addm2 + end interface +!$omp declare reduction(+:dt:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) +!$omp declare reduction(.myadd.:dt:omp_out=omp_out.myadd.omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) + interface operator(.myadd.) + module procedure addm2 + end interface + private + public :: operator(+), operator(.myadd.), dt +contains + type(dt) function addm2 (x, y) + type(dt), intent (in):: x, y + addm2%r = x%r + y%r + end function +end module udr7m2 +module udr7m3 + use udr7m1 + private + public :: operator(.myadd.), operator(+), dt + interface operator(.myadd.) + module procedure addm3 + end interface +!$omp declare reduction(+:dt:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) +!$omp declare reduction(.myadd.:dt:omp_out=omp_out.myadd.omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) + interface operator(+) + module procedure addm3 + end interface +contains + type(dt) function addm3 (x, y) + type(dt), intent (in):: x, y + addm3%r = x%r + y%r + end function +end module udr7m3 +module udr7m4 + use udr7m1 + private + interface operator(.myadd.) + module procedure addm4 + end interface +!$omp declare reduction(+:dt:omp_out=omp_out+omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) +!$omp declare reduction(.myadd.:dt:omp_out=omp_out.myadd.omp_in) & +!$omp & initializer(omp_priv=dt(0.0)) + interface operator(+) + module procedure addm4 + end interface +contains + type(dt) function addm4 (x, y) + type(dt), intent (in):: x, y + addm4%r = x%r + y%r + end function +end module udr7m4 +subroutine f1 + use udr7m2 + type(dt) :: d, e + integer :: i + d=dt(0.0) + e = dt (0.0) +!$omp parallel do reduction (+ : d) reduction ( .myadd. : e) + do i=1,100 + d=d+dt(i) + e=e+dt(i) + end do +end subroutine f1 +subroutine f2 + use udr7m3 ! { dg-error "Previous !.OMP DECLARE REDUCTION|Ambiguous interfaces" } + use udr7m2 ! { dg-error "Ambiguous !.OMP DECLARE REDUCTION" } +end subroutine f2 +subroutine f3 + use udr7m4 + use udr7m2 +end subroutine f3 +subroutine f4 + use udr7m3 + use udr7m4 +end subroutine f4 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr8.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr8.f90 new file mode 100644 index 000000000..e040b3d1e --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/gomp/udr8.f90 @@ -0,0 +1,351 @@ +! { dg-do compile } +! { dg-options "-fmax-errors=1000 -fopenmp" } + +module m +contains + function fn1 (x, y) + integer, intent(in) :: x, y + integer :: fn1 + fn1 = x + 2 * y + end function + subroutine sub1 (x, y) + integer, intent(in) :: y + integer, intent(out) :: x + x = y + end subroutine + function fn2 (x) + integer, intent(in) :: x + integer :: fn2 + fn2 = x + end function + subroutine sub2 (x, y) + integer, intent(in) :: y + integer, intent(inout) :: x + x = x + y + end subroutine + function fn3 (x, y) + integer, intent(in) :: x(:), y(:) + integer :: fn3(lbound(x, 1):ubound(x, 1)) + fn3 = x + 2 * y + end function + subroutine sub3 (x, y) + integer, intent(in) :: y(:) + integer, intent(out) :: x(:) + x = y + end subroutine + function fn4 (x) + integer, intent(in) :: x(:) + integer :: fn4(lbound(x, 1):ubound(x, 1)) + fn4 = x + end function + subroutine sub4 (x, y) + integer, intent(in) :: y(:) + integer, intent(inout) :: x(:) + x = x + y + end subroutine + function fn5 (x, y) + integer, intent(in) :: x(10), y(10) + integer :: fn5(10) + fn5 = x + 2 * y + end function + subroutine sub5 (x, y) + integer, intent(in) :: y(10) + integer, intent(out) :: x(10) + x = y + end subroutine + function fn6 (x) + integer, intent(in) :: x(10) + integer :: fn6(10) + fn6 = x + end function + subroutine sub6 (x, y) + integer, intent(in) :: y(10) + integer, intent(inout) :: x(10) + x = x + y + end subroutine + function fn7 (x, y) + integer, allocatable, intent(in) :: x(:), y(:) + integer, allocatable :: fn7(:) + fn7 = x + 2 * y + end function + subroutine sub7 (x, y) + integer, allocatable, intent(in) :: y(:) + integer, allocatable, intent(out) :: x(:) + x = y + end subroutine + function fn8 (x) + integer, allocatable, intent(in) :: x(:) + integer, allocatable :: fn8(:) + fn8 = x + end function + subroutine sub8 (x, y) + integer, allocatable, intent(in) :: y(:) + integer, allocatable, intent(inout) :: x(:) + x = x + y + end subroutine +end module +subroutine test1 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn1 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" } +!$omp & initializer (sub1 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" } +!$omp declare reduction (baz : integer : sub2 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" } +!$omp initializer (omp_priv = fn2 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" } + integer :: a(10) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test1 +subroutine test2 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn1 (omp_out, omp_in)) & +!$omp & initializer (sub1 (omp_priv, omp_orig)) +!$omp declare reduction (baz : integer : sub2 (omp_out, omp_in)) & +!$omp initializer (omp_priv = fn2 (omp_orig)) + integer :: a +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test2 +subroutine test3 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn1 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" } +!$omp & initializer (sub1 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" } +!$omp declare reduction (baz : integer : sub2 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" } +!$omp initializer (omp_priv = fn2 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*scalar and rank-1" } + integer, allocatable :: a(:) + allocate (a(10)) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test3 +subroutine test4 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn1 (omp_out, omp_in)) & +!$omp & initializer (sub1 (omp_priv, omp_orig)) +!$omp declare reduction (baz : integer : sub2 (omp_out, omp_in)) & +!$omp initializer (omp_priv = fn2 (omp_orig)) + integer, allocatable :: a + allocate (a) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test4 +subroutine test5 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn3 (omp_out, omp_in)) & +!$omp & initializer (sub3 (omp_priv, omp_orig)) +!$omp declare reduction (baz : integer : sub4 (omp_out, omp_in)) & +!$omp initializer (omp_priv = fn4 (omp_orig)) + integer :: a(10) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test5 +subroutine test6 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn3 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } +!$omp & initializer (sub3 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp declare reduction (baz : integer : sub4 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp initializer (omp_priv = fn4 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } + integer :: a +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test6 +subroutine test7 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn3 (omp_out, omp_in)) & +!$omp & initializer (sub3 (omp_priv, omp_orig)) +!$omp declare reduction (baz : integer : sub4 (omp_out, omp_in)) & +!$omp initializer (omp_priv = fn4 (omp_orig)) + integer, allocatable :: a(:) + allocate (a(10)) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test7 +subroutine test8 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn3 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } +!$omp & initializer (sub3 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp declare reduction (baz : integer : sub4 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp initializer (omp_priv = fn4 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } + integer, allocatable :: a + allocate (a) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test8 +subroutine test9 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn5 (omp_out, omp_in)) & +!$omp & initializer (sub5 (omp_priv, omp_orig)) +!$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) & +!$omp initializer (omp_priv = fn6 (omp_orig)) + integer :: a(10) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test9 +subroutine test10 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn5 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } +!$omp & initializer (sub5 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp initializer (omp_priv = fn6 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } + integer :: a +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test10 +subroutine test11 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn5 (omp_out, omp_in)) & +!$omp & initializer (sub5 (omp_priv, omp_orig)) +!$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) & +!$omp initializer (omp_priv = fn6 (omp_orig)) + integer, allocatable :: a(:) + allocate (a(10)) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test11 +subroutine test12 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn5 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } +!$omp & initializer (sub5 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp initializer (omp_priv = fn6 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } + integer, allocatable :: a + allocate (a) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test12 +subroutine test13 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = & ! { dg-error "Different shape for array assignment at \[^\n\r]* on dimension 1 .9 and 10" } +!$omp & fn5 (omp_out, omp_in)) & ! { dg-warning "Actual argument contains too few elements for dummy argument \[^\n\r]* .9/10" } +!$omp & initializer (sub5 (omp_priv, omp_orig)) ! { dg-warning "Actual argument contains too few elements for dummy argument \[^\n\r]* .9/10" } +!$omp declare reduction (baz : integer : sub6 (omp_out, omp_in)) & ! { dg-warning "Actual argument contains too few elements for dummy argument \[^\n\r]* .9/10" } +!$omp initializer (omp_priv = & ! { dg-error "Different shape for array assignment at \[^\n\r]* on dimension 1 .9 and 10" } +!$omp & fn6 (omp_orig)) ! { dg-warning "Actual argument contains too few elements for dummy argument \[^\n\r]* .9/10" } + integer :: a(9) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test13 +subroutine test14 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn7 (omp_out, omp_in)) & ! { dg-error "Actual argument for \[^\n\r]* must be ALLOCATABLE" } +!$omp & initializer (sub7 (omp_priv, omp_orig)) ! { dg-error "Actual argument for \[^\n\r]* must be ALLOCATABLE" } +!$omp declare reduction (baz : integer : sub8 (omp_out, omp_in)) & ! { dg-error "Actual argument for \[^\n\r]* must be ALLOCATABLE" } +!$omp initializer (omp_priv = fn8 (omp_orig)) ! { dg-error "Actual argument for \[^\n\r]* must be ALLOCATABLE" } + integer :: a(10) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test14 +subroutine test15 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn7 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } +!$omp & initializer (sub7 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp declare reduction (baz : integer : sub8 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp initializer (omp_priv = fn8 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } + integer :: a +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test15 +subroutine test16 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn7 (omp_out, omp_in)) & +!$omp & initializer (sub7 (omp_priv, omp_orig)) +!$omp declare reduction (baz : integer : sub8 (omp_out, omp_in)) & +!$omp initializer (omp_priv = fn8 (omp_orig)) + integer, allocatable :: a(:) + allocate (a(10)) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test16 +subroutine test17 + use m +!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) initializer (omp_priv = 0) +!$omp declare reduction (bar : integer : omp_out = fn7 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } +!$omp & initializer (sub7 (omp_priv, omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp declare reduction (baz : integer : sub8 (omp_out, omp_in)) & ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar" } +!$omp initializer (omp_priv = fn8 (omp_orig)) ! { dg-error "Rank mismatch in argument\[^\n\r]*rank-1 and scalar|Incompatible ranks 0 and 1 in assignment" } + integer, allocatable :: a + allocate (a) +!$omp parallel reduction (foo : a) +!$omp end parallel +!$omp parallel reduction (bar : a) +!$omp end parallel +!$omp parallel reduction (baz : a) +!$omp end parallel +end subroutine test17 diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/graphite/pr59817.f b/gcc-4.9/gcc/testsuite/gfortran.dg/graphite/pr59817.f new file mode 100644 index 000000000..a9ee8f19d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/graphite/pr59817.f @@ -0,0 +1,14 @@ +! { dg-do compile } +! { dg-options "-O2 -floop-interchange" } + SUBROUTINE PREPD(ICAST,ICAS,ICASX,ICAS1,ICAS2,NDET,NM,III,IMP, + * CASMIN) + LOGICAL CASMIN + DIMENSION ICAST(NDET,NM),IMP(NM) + IF(CASMIN) THEN + DO K=1,NDET + DO L=1,NM + IF(L.EQ.K-1) ICAST(K,L) = 1 + END DO + END DO + END IF + END SUBROUTINE diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/guality/guality.exp b/gcc-4.9/gcc/testsuite/gfortran.dg/guality/guality.exp index b3f64fbed..8f61ca360 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/guality/guality.exp +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/guality/guality.exp @@ -1,5 +1,8 @@ # This harness is for tests that should be run at all optimisation levels. +# Disable everywhere. These tests are very flaky. +return + load_lib gfortran-dg.exp load_lib gcc-gdb-test.exp diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/list_read_13.f b/gcc-4.9/gcc/testsuite/gfortran.dg/list_read_13.f new file mode 100644 index 000000000..0f8efd86c --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/list_read_13.f @@ -0,0 +1,13 @@ +c { dg-do run } +c PR61049, reduced test case by Dominique d'Humieres + character(len=30) :: buff = ", (2.0, 3.0),,6.0D0, 2*," + DOUBLE PRECISION AVD, BVD, CVD, DVCORR + COMPLEX AVC, BVC, CVC, ZVCORR + + read(buff, *, err=10) AVD, AVC, BVC, BVD, CVC, CVD + goto 20 + 10 call abort + 20 continue + end + + diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/nint_2.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/nint_2.f90 index 9f2705318..0727136df 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/nint_2.f90 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/nint_2.f90 @@ -4,7 +4,8 @@ ! http://gcc.gnu.org/ml/fortran/2005-04/msg00139.html ! ! { dg-do run } -! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix* powerpc*-*-linux* *-*-mingw* } { "-O0" } { "" } } +! { dg-xfail-run-if "PR 33271, math library bug" { powerpc-ibm-aix* powerpc-*-linux* powerpc64-*-linux* *-*-mingw* } { "-O0" } { "" } } +! Note that this doesn't fail on powerpc64le-*-linux*. real(kind=8) :: a integer(kind=8) :: i1, i2 real :: b diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/oldstyle_5.f b/gcc-4.9/gcc/testsuite/gfortran.dg/oldstyle_5.f new file mode 100644 index 000000000..8a0d3119f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/oldstyle_5.f @@ -0,0 +1,8 @@ +C { dg-do compile } + TYPE T + INTEGER A(2)/1,2/ ! { dg-error "Invalid old style initialization for derived type component" } + END TYPE + TYPE S + INTEGER B/1/ ! { dg-error "Invalid old style initialization for derived type component" } + END TYPE + END diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/openmp-define-3.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/openmp-define-3.f90 index 3d559864f..44d5c9de4 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/openmp-define-3.f90 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/openmp-define-3.f90 @@ -6,6 +6,6 @@ # error _OPENMP not defined #endif -#if _OPENMP != 201107 +#if _OPENMP != 201307 # error _OPENMP defined to wrong value #endif diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/round_4.f90 b/gcc-4.9/gcc/testsuite/gfortran.dg/round_4.f90 index 975cb20e4..f60e1f785 100644 --- a/gcc-4.9/gcc/testsuite/gfortran.dg/round_4.f90 +++ b/gcc-4.9/gcc/testsuite/gfortran.dg/round_4.f90 @@ -1,6 +1,7 @@ ! { dg-do run } ! { dg-add-options ieee } ! { dg-skip-if "PR libfortran/58015" { *-*-solaris2.9* hppa*-*-hpux* } } +! { dg-skip-if "IBM long double 31 bits of precision, test requires 38" { powerpc*-*-linux* } } ! ! PR fortran/35862 ! diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/aliasing1.adb b/gcc-4.9/gcc/testsuite/gnat.dg/aliasing1.adb index b2b7d123b..bffc4225b 100644 --- a/gcc-4.9/gcc/testsuite/gnat.dg/aliasing1.adb +++ b/gcc-4.9/gcc/testsuite/gnat.dg/aliasing1.adb @@ -18,5 +18,5 @@ package body Aliasing1 is end Aliasing1; --- { dg-final { scan-tree-dump-not "__gnat_rcheck" "optimized" } } +-- { dg-final { scan-tree-dump-not "gnat_rcheck" "optimized" } } -- { dg-final { cleanup-tree-dump "optimized" } } diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/enum3.adb b/gcc-4.9/gcc/testsuite/gnat.dg/enum3.adb new file mode 100644 index 000000000..1cb6c4b56 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gnat.dg/enum3.adb @@ -0,0 +1,23 @@ +-- { dg-do run } + +procedure Enum3 is + type Enum is (Aaa, Bbb, Ccc); + for Enum use (1,2,4); +begin + for Lo in Enum loop + for Hi in Enum loop + declare + subtype S is Enum range Lo .. Hi; + type Vector is array (S) of Integer; + Vec : Vector; + begin + for I in S loop + Vec (I) := 0; + end loop; + if Vec /= (S => 0) then + raise Program_Error; + end if; + end; + end loop; + end loop; +end; diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/opt38.adb b/gcc-4.9/gcc/testsuite/gnat.dg/opt38.adb new file mode 100644 index 000000000..143f4fade --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gnat.dg/opt38.adb @@ -0,0 +1,9 @@ +-- { dg-do run } +-- { dg-options "-O2 -gnatn" } + +with Opt38_Pkg; use Opt38_Pkg; + +procedure Opt38 is +begin + Test (-1); +end; diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.adb b/gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.adb new file mode 100644 index 000000000..7cbbeeab3 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.adb @@ -0,0 +1,33 @@ +package body Opt38_Pkg is + + procedure Proc (I : Integer); + pragma Inline (Proc); + + procedure Proc (I : Integer) is + + procedure Inner; + pragma No_Inline (Inner); + + procedure Inner is + begin + if I /= 110 then + raise Program_Error; + end if; + end; + + begin + if I > 0 then + Inner; + end if; + end; + + procedure Test (I : Integer) is + begin + if I > -1 then + Proc (I); + else + Proc (I + 111); + end if; + end; + +end Opt38_Pkg; diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.ads b/gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.ads new file mode 100644 index 000000000..b6cb4e6bc --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gnat.dg/opt38_pkg.ads @@ -0,0 +1,5 @@ +package Opt38_Pkg is + + procedure Test (I : Integer); + +end Opt38_Pkg; diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/opt39.adb b/gcc-4.9/gcc/testsuite/gnat.dg/opt39.adb new file mode 100644 index 000000000..a00cac75f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gnat.dg/opt39.adb @@ -0,0 +1,31 @@ +-- { dg-do compile } +-- { dg-options "-O2 -fno-inline -fdump-tree-optimized" } + +procedure Opt39 (I : Integer) is + + type Rec is record + I1 : Integer; + I2 : Integer; + I3 : Integer; + I4 : Integer; + I5 : Integer; + end record; + + procedure Set (A : access Rec; I : Integer) is + Tmp : Rec := A.all; + begin + Tmp.I1 := I; + A.all := Tmp; + end; + + R : aliased Rec; + +begin + Set (R'Access, I); + if R.I1 /= I then + raise Program_Error; + end if; +end; + +-- { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } } +-- { dg-final { cleanup-tree-dump "optimized" } } diff --git a/gcc-4.9/gcc/testsuite/gnat.dg/overflow_fixed.adb b/gcc-4.9/gcc/testsuite/gnat.dg/overflow_fixed.adb new file mode 100644 index 000000000..6ece51523 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gnat.dg/overflow_fixed.adb @@ -0,0 +1,19 @@ +-- { dg-do run } +-- { dg-options "-gnato -O" } + +procedure Overflow_Fixed is + + type Unsigned_8_Bit is mod 2**8; + + procedure Fixed_To_Eight (Value : Duration) is + Item : Unsigned_8_Bit; + begin + Item := Unsigned_8_Bit(Value); + raise Program_Error; + exception + when Constraint_Error => null; -- expected case + end; + +begin + Fixed_To_Eight (-0.5); +end; diff --git a/gcc-4.9/gcc/testsuite/lib/asan-dg.exp b/gcc-4.9/gcc/testsuite/lib/asan-dg.exp index 9ba39db15..f4ec44577 100644 --- a/gcc-4.9/gcc/testsuite/lib/asan-dg.exp +++ b/gcc-4.9/gcc/testsuite/lib/asan-dg.exp @@ -85,12 +85,12 @@ proc asan_init { args } { } if [info exists ALWAYS_CXXFLAGS] { set ALWAYS_CXXFLAGS [concat "{ldflags=$link_flags}" $ALWAYS_CXXFLAGS] - set ALWAYS_CXXFLAGS [concat "{additional_flags=-fsanitize=address -g}" $ALWAYS_CXXFLAGS] + set ALWAYS_CXXFLAGS [concat "{additional_flags=-fsanitize=address -static-libasan -g}" $ALWAYS_CXXFLAGS] } else { if [info exists TEST_ALWAYS_FLAGS] { - set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=address -g $TEST_ALWAYS_FLAGS" + set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=address -static-libasan -g $TEST_ALWAYS_FLAGS" } else { - set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=address -g" + set TEST_ALWAYS_FLAGS "$link_flags -fsanitize=address -static-libasan -g" } } if { $link_flags != "" } { diff --git a/gcc-4.9/gcc/testsuite/lib/clearcap.exp b/gcc-4.9/gcc/testsuite/lib/clearcap.exp new file mode 100644 index 000000000..044881fbd --- /dev/null +++ b/gcc-4.9/gcc/testsuite/lib/clearcap.exp @@ -0,0 +1,58 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Clear hardware capabilities on Solaris. +if [istarget *-*-solaris2*] { + set clearcap_ldflags "-mclear-hwcap" +} + +# +# clearcap-init -- called at the start of each subdir of tests +# + +proc clearcap-init { args } { + global TEST_ALWAYS_FLAGS + global ALWAYS_CXXFLAGS + global clearcap_saved_TEST_ALWAYS_FLAGS + global clearcap_ldflags + + if [info exists TEST_ALWAYS_FLAGS] { + set clearcap_saved_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS + } + if [info exists clearcap_ldflags] { + if [info exists ALWAYS_CXXFLAGS] { + set ALWAYS_CXXFLAGS [concat "{ldflags=$clearcap_ldflags}" $ALWAYS_CXXFLAGS] + } else { + append TEST_ALWAYS_FLAGS " $clearcap_ldflags" + } + } + return 0 +} + +# +# clearcap-finish -- called at the start of each subdir of tests +# + +proc clearcap-finish { args } { + global TEST_ALWAYS_FLAGS + global clearcap_saved_TEST_ALWAYS_FLAGS + + if [info exists clearcap_saved_TEST_ALWAYS_FLAGS] { + set TEST_ALWAYS_FLAGS $clearcap_saved_TEST_ALWAYS_FLAGS + } else { + unset TEST_ALWAYS_FLAGS + } +} diff --git a/gcc-4.9/gcc/testsuite/lib/gcov.exp b/gcc-4.9/gcc/testsuite/lib/gcov.exp index 7e4ed6937..9086fe635 100644 --- a/gcc-4.9/gcc/testsuite/lib/gcov.exp +++ b/gcc-4.9/gcc/testsuite/lib/gcov.exp @@ -303,6 +303,8 @@ proc run-gcov { args } { set gcov_args "" set gcov_verify_calls 0 set gcov_verify_branches 0 + set gcov_execute_xfail "" + set gcov_verify_xfail "" set gcov_verify_lines 1 set gcov_verify_intermediate 0 set xfailed 0 diff --git a/gcc-4.9/gcc/testsuite/lib/profopt.exp b/gcc-4.9/gcc/testsuite/lib/profopt.exp index cb6a350dd..a6e4d8903 100644 --- a/gcc-4.9/gcc/testsuite/lib/profopt.exp +++ b/gcc-4.9/gcc/testsuite/lib/profopt.exp @@ -249,6 +249,27 @@ proc profopt-execute { src } { set executable $tmpdir/[file tail [file rootname $src].x] set basename [file tail $testcase] set base [file rootname $basename] + set dir [file dirname $src] + # multiple file test base + set mbase [file rootname $basename] + regsub "_0" $mbase "" mbase + regsub "/" $mbase "" mbase + set src_list $src + set i 1 + set done 0 + while { !$done } { + set names [glob -nocomplain -types f -- "${dir}/${mbase}_${i}.*"] + if { [llength ${names}] > 1 } { + warning "profopt-execute: more than one file matched ${dir}/${mbase}_${i}.*" + } + if { [llength ${names}] == 1 } { + lappend src_list [lindex ${names} 0] + incr i + } else { + set num_srcs ${i} + set done 1 + } + } set count 0 foreach option $prof_option_list { @@ -296,7 +317,7 @@ proc profopt-execute { src } { set options "$extra_options" lappend options "additional_flags=$option $extra_flags $profile_option" set optstr "$option $profile_option" - set comp_output [${tool}_target_compile "$src" "$execname1" executable $options] + set comp_output [${tool}_target_compile "$src_list" "$execname1" executable $options] if ![${tool}_check_compile "$testcase compilation" $optstr $execname1 $comp_output] { unresolved "$testcase execution, $optstr" unresolved "$testcase compilation, $option $feedback_option" @@ -311,15 +332,32 @@ proc profopt-execute { src } { set missing_file 0 # Make sure the profile data was generated, and fail if not. if { $status == "pass" } { - foreach ext $prof_ext { - remote_upload target $tmpdir/$base.$ext - set files [glob -nocomplain $base.$ext] - if { $files == "" } { - set status "fail" - set missing_file 1 - fail "$testcase execution: file $base.$ext does not exist, $option $profile_option" - } - } + set i 0 + if { $num_srcs > 1 } { + foreach s $src_list { + foreach ext $prof_ext { + remote_upload target $tmpdir/${mbase}_${i}.$ext + set files [glob -nocomplain ${mbase}_${i}.$ext] + if { $files == "" } { + set status "fail" + set missing_file 1 + fail "$testcase execution: file ${mbase}_${i}.$ext does not exist, $option $profile_option" + } + } + incr i + } + } else { + foreach ext $prof_ext { + remote_upload target $tmpdir/$base.$ext + set files [glob -nocomplain $base.$ext] + if { $files == "" } { + set status "fail" + set missing_file 1 + fail "$testcase execution: file $base.$ext does not exist, $option $profile_option" + } + } + } + } if { $missing_file == 0 } { $status "$testcase execution, $optstr" @@ -345,7 +383,7 @@ proc profopt-execute { src } { set options "$extra_options" lappend options "additional_flags=$option $extra_flags $feedback_option" set optstr "$option $feedback_option" - set comp_output [${tool}_target_compile "$src" "$execname2" "executable" $options] + set comp_output [${tool}_target_compile "$src_list" "$execname2" "executable" $options] # Prune warnings we know are unwanted. set comp_output [prune_warnings $comp_output] @@ -367,8 +405,18 @@ proc profopt-execute { src } { } # Remove the profiling data files. - foreach ext $prof_ext { - remote_file target delete $tmpdir/$base.$ext + if { $num_srcs > 1 } { + set i 0 + foreach s $src_list { + foreach ext $prof_ext { + remote_file target delete $tmpdir/${mbase}_${i}.$ext + } + incr i + } + } else { + foreach ext $prof_ext { + remote_file target delete $tmpdir/$base.$ext + } } if { $status != "pass" } { @@ -396,7 +444,7 @@ proc profopt-execute { src } { set options "$extra_options" lappend options "additional_flags=$option" set optstr "$option" - set comp_output [${tool}_target_compile "$src" "$execname3" "executable" $options] + set comp_output [${tool}_target_compile "$src_list" "$execname3" "executable" $options] if ![${tool}_check_compile "$testcase compilation" $optstr $execname3 $comp_output] { unresolved "$testcase execution, $optstr" unresolved "$testcase perf check, $optstr" diff --git a/gcc-4.9/gcc/testsuite/lib/target-supports-dg.exp b/gcc-4.9/gcc/testsuite/lib/target-supports-dg.exp index 171dc1b47..9128a5486 100644 --- a/gcc-4.9/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc-4.9/gcc/testsuite/lib/target-supports-dg.exp @@ -127,6 +127,25 @@ proc dg-require-ifunc { args } { } } +# If this target does not support the section exclude "e" attribute, +# skip this test. + +proc dg-require-section-exclude { args } { + if { ![ check_section_exclude_available ] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} +# If this target uses a linker that supports plugins and can load +# the function reordering linker plugin. + +proc dg-require-linker-function-reordering-plugin {args } { + if { ![ check_linker_function_reordering_plugin_supported ] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + # If this target's linker does not support the --gc-sections flag, # skip this test. diff --git a/gcc-4.9/gcc/testsuite/lib/target-supports.exp b/gcc-4.9/gcc/testsuite/lib/target-supports.exp index 4f1325bde..902771bd5 100644 --- a/gcc-4.9/gcc/testsuite/lib/target-supports.exp +++ b/gcc-4.9/gcc/testsuite/lib/target-supports.exp @@ -382,6 +382,30 @@ proc check_ifunc_available { } { }] } +# Returns true if tool chain supports "e" section attribute. + +proc check_section_exclude_available { } { + return [check_runtime_nocache section_exclude_available { + asm(".section \".gnu.callgraph.text.main\", \"e\""); + int main() + { + return 0; + } + }] +} + +# If this target uses a linker that supports plugins and can load +# the function reordering linker plugin. + +proc check_linker_function_reordering_plugin_supported {} { + return [check_runtime_nocache function_reordering_plugin_supported { + int main() + { + return 0; + } + } "-freorder-functions=callgraph"] +} + # Returns true if --gc-sections is supported on the target. proc check_gc_sections_available { } { @@ -1917,6 +1941,15 @@ proc check_effective_target_large_double { } { }] } +# Return 1 if the target supports long double of 128 bits, +# 0 otherwise. + +proc check_effective_target_longdouble128 { } { + return [check_no_compiler_messages longdouble128 object { + int dummy[sizeof(long double) == 16 ? 1 : -1]; + }] +} + # Return 1 if the target supports double of 64 bits, # 0 otherwise. @@ -3990,6 +4023,26 @@ proc check_effective_target_vect_udot_hi { } { return $et_vect_udot_hi_saved } +# Return 1 if the target plus current options supports a vector +# sad operation of unsigned chars, 0 otherwise. +# +# This won't change for different subtargets so cache the result. + +proc check_effective_target_vect_usad_char { } { + global et_vect_usad_char + + if [info exists et_vect_usad_char_saved] { + verbose "check_effective_target_vect_usad_char: using cached result" 2 + } else { + set et_vect_usad_char_saved 0 + if { ([istarget i?86-*-*] + || [istarget x86_64-*-*]) } { + set et_vect_usad_char_saved 1 + } + } + verbose "check_effective_target_vect_usad_char: returning $et_vect_usad_char_saved" 2 + return $et_vect_usad_char_saved +} # Return 1 if the target plus current options supports a vector # demotion (packing) of shorts (to chars) and ints (to shorts) diff --git a/gcc-4.9/gcc/testsuite/lib/target-supports.exp.orig b/gcc-4.9/gcc/testsuite/lib/target-supports.exp.orig deleted file mode 100644 index 7d296d902..000000000 --- a/gcc-4.9/gcc/testsuite/lib/target-supports.exp.orig +++ /dev/null @@ -1,5791 +0,0 @@ -# Copyright (C) 1999-2014 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GCC; see the file COPYING3. If not see -# . - -# Please email any bugs, comments, and/or additions to this file to: -# gcc-patches@gcc.gnu.org - -# This file defines procs for determining features supported by the target. - -# Try to compile the code given by CONTENTS into an output file of -# type TYPE, where TYPE is as for target_compile. Return a list -# whose first element contains the compiler messages and whose -# second element is the name of the output file. -# -# BASENAME is a prefix to use for source and output files. -# If ARGS is not empty, its first element is a string that -# should be added to the command line. -# -# Assume by default that CONTENTS is C code. -# Otherwise, code should contain: -# "// C++" for c++, -# "! Fortran" for Fortran code, -# "/* ObjC", for ObjC -# "// ObjC++" for ObjC++ -# and "// Go" for Go -# If the tool is ObjC/ObjC++ then we overide the extension to .m/.mm to -# allow for ObjC/ObjC++ specific flags. -proc check_compile {basename type contents args} { - global tool - verbose "check_compile tool: $tool for $basename" - - if { [llength $args] > 0 } { - set options [list "additional_flags=[lindex $args 0]"] - } else { - set options "" - } - switch -glob -- $contents { - "*! Fortran*" { set src ${basename}[pid].f90 } - "*// C++*" { set src ${basename}[pid].cc } - "*// ObjC++*" { set src ${basename}[pid].mm } - "*/* ObjC*" { set src ${basename}[pid].m } - "*// Go*" { set src ${basename}[pid].go } - default { - switch -- $tool { - "objc" { set src ${basename}[pid].m } - "obj-c++" { set src ${basename}[pid].mm } - default { set src ${basename}[pid].c } - } - } - } - - set compile_type $type - switch -glob $type { - assembly { set output ${basename}[pid].s } - object { set output ${basename}[pid].o } - executable { set output ${basename}[pid].exe } - "rtl-*" { - set output ${basename}[pid].s - lappend options "additional_flags=-fdump-$type" - set compile_type assembly - } - } - set f [open $src "w"] - puts $f $contents - close $f - set lines [${tool}_target_compile $src $output $compile_type "$options"] - file delete $src - - set scan_output $output - # Don't try folding this into the switch above; calling "glob" before the - # file is created won't work. - if [regexp "rtl-(.*)" $type dummy rtl_type] { - set scan_output "[glob $src.\[0-9\]\[0-9\]\[0-9\]r.$rtl_type]" - file delete $output - } - - return [list $lines $scan_output] -} - -proc current_target_name { } { - global target_info - if [info exists target_info(target,name)] { - set answer $target_info(target,name) - } else { - set answer "" - } - return $answer -} - -# Implement an effective-target check for property PROP by invoking -# the Tcl command ARGS and seeing if it returns true. - -proc check_cached_effective_target { prop args } { - global et_cache - - set target [current_target_name] - if {![info exists et_cache($prop,target)] - || $et_cache($prop,target) != $target} { - verbose "check_cached_effective_target $prop: checking $target" 2 - set et_cache($prop,target) $target - set et_cache($prop,value) [uplevel eval $args] - } - set value $et_cache($prop,value) - verbose "check_cached_effective_target $prop: returning $value for $target" 2 - return $value -} - -# Like check_compile, but delete the output file and return true if the -# compiler printed no messages. -proc check_no_compiler_messages_nocache {args} { - set result [eval check_compile $args] - set lines [lindex $result 0] - set output [lindex $result 1] - remote_file build delete $output - return [string match "" $lines] -} - -# Like check_no_compiler_messages_nocache, but cache the result. -# PROP is the property we're checking, and doubles as a prefix for -# temporary filenames. -proc check_no_compiler_messages {prop args} { - return [check_cached_effective_target $prop { - eval [list check_no_compiler_messages_nocache $prop] $args - }] -} - -# Like check_compile, but return true if the compiler printed no -# messages and if the contents of the output file satisfy PATTERN. -# If PATTERN has the form "!REGEXP", the contents satisfy it if they -# don't match regular expression REGEXP, otherwise they satisfy it -# if they do match regular expression PATTERN. (PATTERN can start -# with something like "[!]" if the regular expression needs to match -# "!" as the first character.) -# -# Delete the output file before returning. The other arguments are -# as for check_compile. -proc check_no_messages_and_pattern_nocache {basename pattern args} { - global tool - - set result [eval [list check_compile $basename] $args] - set lines [lindex $result 0] - set output [lindex $result 1] - - set ok 0 - if { [string match "" $lines] } { - set chan [open "$output"] - set invert [regexp {^!(.*)} $pattern dummy pattern] - set ok [expr { [regexp $pattern [read $chan]] != $invert }] - close $chan - } - - remote_file build delete $output - return $ok -} - -# Like check_no_messages_and_pattern_nocache, but cache the result. -# PROP is the property we're checking, and doubles as a prefix for -# temporary filenames. -proc check_no_messages_and_pattern {prop pattern args} { - return [check_cached_effective_target $prop { - eval [list check_no_messages_and_pattern_nocache $prop $pattern] $args - }] -} - -# Try to compile and run an executable from code CONTENTS. Return true -# if the compiler reports no messages and if execution "passes" in the -# usual DejaGNU sense. The arguments are as for check_compile, with -# TYPE implicitly being "executable". -proc check_runtime_nocache {basename contents args} { - global tool - - set result [eval [list check_compile $basename executable $contents] $args] - set lines [lindex $result 0] - set output [lindex $result 1] - - set ok 0 - if { [string match "" $lines] } { - # No error messages, everything is OK. - set result [remote_load target "./$output" "" ""] - set status [lindex $result 0] - verbose "check_runtime_nocache $basename: status is <$status>" 2 - if { $status == "pass" } { - set ok 1 - } - } - remote_file build delete $output - return $ok -} - -# Like check_runtime_nocache, but cache the result. PROP is the -# property we're checking, and doubles as a prefix for temporary -# filenames. -proc check_runtime {prop args} { - global tool - - return [check_cached_effective_target $prop { - eval [list check_runtime_nocache $prop] $args - }] -} - -############################### -# proc check_weak_available { } -############################### - -# weak symbols are only supported in some configs/object formats -# this proc returns 1 if they're supported, 0 if they're not, or -1 if unsure - -proc check_weak_available { } { - global target_cpu - - # All mips targets should support it - - if { [ string first "mips" $target_cpu ] >= 0 } { - return 1 - } - - # All AIX targets should support it - - if { [istarget *-*-aix*] } { - return 1 - } - - # All solaris2 targets should support it - - if { [istarget *-*-solaris2*] } { - return 1 - } - - # Windows targets Cygwin and MingW32 support it - - if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } { - return 1 - } - - # HP-UX 10.X doesn't support it - - if { [istarget hppa*-*-hpux10*] } { - return 0 - } - - # ELF and ECOFF support it. a.out does with gas/gld but may also with - # other linkers, so we should try it - - set objformat [gcc_target_object_format] - - switch $objformat { - elf { return 1 } - ecoff { return 1 } - a.out { return 1 } - mach-o { return 1 } - som { return 1 } - unknown { return -1 } - default { return 0 } - } -} - -############################### -# proc check_weak_override_available { } -############################### - -# Like check_weak_available, but return 0 if weak symbol definitions -# cannot be overridden. - -proc check_weak_override_available { } { - if { [istarget *-*-mingw*] } { - return 0 - } - return [check_weak_available] -} - -############################### -# proc check_visibility_available { what_kind } -############################### - -# The visibility attribute is only support in some object formats -# This proc returns 1 if it is supported, 0 if not. -# The argument is the kind of visibility, default/protected/hidden/internal. - -proc check_visibility_available { what_kind } { - if [string match "" $what_kind] { set what_kind "hidden" } - - return [check_no_compiler_messages visibility_available_$what_kind object " - void f() __attribute__((visibility(\"$what_kind\"))); - void f() {} - "] -} - -############################### -# proc check_alias_available { } -############################### - -# Determine if the target toolchain supports the alias attribute. - -# Returns 2 if the target supports aliases. Returns 1 if the target -# only supports weak aliased. Returns 0 if the target does not -# support aliases at all. Returns -1 if support for aliases could not -# be determined. - -proc check_alias_available { } { - global alias_available_saved - global tool - - if [info exists alias_available_saved] { - verbose "check_alias_available returning saved $alias_available_saved" 2 - } else { - set src alias[pid].c - set obj alias[pid].o - verbose "check_alias_available compiling testfile $src" 2 - set f [open $src "w"] - # Compile a small test program. The definition of "g" is - # necessary to keep the Solaris assembler from complaining - # about the program. - puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif\n" - puts $f "void g() {} void f() __attribute__((alias(\"g\")));" - close $f - set lines [${tool}_target_compile $src $obj object ""] - file delete $src - remote_file build delete $obj - - if [string match "" $lines] then { - # No error messages, everything is OK. - set alias_available_saved 2 - } else { - if [regexp "alias definitions not supported" $lines] { - verbose "check_alias_available target does not support aliases" 2 - - set objformat [gcc_target_object_format] - - if { $objformat == "elf" } { - verbose "check_alias_available but target uses ELF format, so it ought to" 2 - set alias_available_saved -1 - } else { - set alias_available_saved 0 - } - } else { - if [regexp "only weak aliases are supported" $lines] { - verbose "check_alias_available target supports only weak aliases" 2 - set alias_available_saved 1 - } else { - set alias_available_saved -1 - } - } - } - - verbose "check_alias_available returning $alias_available_saved" 2 - } - - return $alias_available_saved -} - -# Returns 1 if the target toolchain supports strong aliases, 0 otherwise. - -proc check_effective_target_alias { } { - if { [check_alias_available] < 2 } { - return 0 - } else { - return 1 - } -} - -# Returns 1 if the target toolchain supports ifunc, 0 otherwise. - -proc check_ifunc_available { } { - return [check_no_compiler_messages ifunc_available object { - #ifdef __cplusplus - extern "C" - #endif - void g() {} - void f() __attribute__((ifunc("g"))); - }] -} - -# Returns true if --gc-sections is supported on the target. - -proc check_gc_sections_available { } { - global gc_sections_available_saved - global tool - - if {![info exists gc_sections_available_saved]} { - # Some targets don't support gc-sections despite whatever's - # advertised by ld's options. - if { [istarget alpha*-*-*] - || [istarget ia64-*-*] } { - set gc_sections_available_saved 0 - return 0 - } - - # elf2flt uses -q (--emit-relocs), which is incompatible with - # --gc-sections. - if { [board_info target exists ldflags] - && [regexp " -elf2flt\[ =\]" " [board_info target ldflags] "] } { - set gc_sections_available_saved 0 - return 0 - } - - # VxWorks kernel modules are relocatable objects linked with -r, - # while RTP executables are linked with -q (--emit-relocs). - # Both of these options are incompatible with --gc-sections. - if { [istarget *-*-vxworks*] } { - set gc_sections_available_saved 0 - return 0 - } - - # Check if the ld used by gcc supports --gc-sections. - set gcc_spec [${tool}_target_compile "-dumpspecs" "" "none" ""] - regsub ".*\n\\*linker:\[ \t\]*\n(\[^ \t\n\]*).*" "$gcc_spec" {\1} linker - set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=$linker" "" "none" ""] 0] - set ld_output [remote_exec host "$gcc_ld" "--help"] - if { [ string first "--gc-sections" $ld_output ] >= 0 } { - set gc_sections_available_saved 1 - } else { - set gc_sections_available_saved 0 - } - } - return $gc_sections_available_saved -} - -# Return 1 if according to target_info struct and explicit target list -# target is supposed to support trampolines. - -proc check_effective_target_trampolines { } { - if [target_info exists no_trampolines] { - return 0 - } - if { [istarget avr-*-*] - || [istarget msp430-*-*] - || [istarget hppa2.0w-hp-hpux11.23] - || [istarget hppa64-hp-hpux11.23] } { - return 0; - } - return 1 -} - -# Return 1 if according to target_info struct and explicit target list -# target is supposed to keep null pointer checks. This could be due to -# use of option fno-delete-null-pointer-checks or hardwired in target. - -proc check_effective_target_keeps_null_pointer_checks { } { - if [target_info exists keeps_null_pointer_checks] { - return 1 - } - if { [istarget avr-*-*] } { - return 1; - } - return 0 -} - -# Return true if profiling is supported on the target. - -proc check_profiling_available { test_what } { - global profiling_available_saved - - verbose "Profiling argument is <$test_what>" 1 - - # These conditions depend on the argument so examine them before - # looking at the cache variable. - - # Tree profiling requires TLS runtime support. - if { $test_what == "-fprofile-generate" } { - if { ![check_effective_target_tls_runtime] } { - return 0 - } - } - - # Support for -p on solaris2 relies on mcrt1.o which comes with the - # vendor compiler. We cannot reliably predict the directory where the - # vendor compiler (and thus mcrt1.o) is installed so we can't - # necessarily find mcrt1.o even if we have it. - if { [istarget *-*-solaris2*] && $test_what == "-p" } { - return 0 - } - - # We don't yet support profiling for MIPS16. - if { [istarget mips*-*-*] - && ![check_effective_target_nomips16] - && ($test_what == "-p" || $test_what == "-pg") } { - return 0 - } - - # MinGW does not support -p. - if { [istarget *-*-mingw*] && $test_what == "-p" } { - return 0 - } - - # cygwin does not support -p. - if { [istarget *-*-cygwin*] && $test_what == "-p" } { - return 0 - } - - # uClibc does not have gcrt1.o. - if { [check_effective_target_uclibc] - && ($test_what == "-p" || $test_what == "-pg") } { - return 0 - } - - # Now examine the cache variable. - if {![info exists profiling_available_saved]} { - # Some targets don't have any implementation of __bb_init_func or are - # missing other needed machinery. - if { [istarget aarch64*-*-elf] - || [istarget am3*-*-linux*] - || [istarget arm*-*-eabi*] - || [istarget arm*-*-elf] - || [istarget arm*-*-symbianelf*] - || [istarget avr-*-*] - || [istarget bfin-*-*] - || [istarget cris-*-*] - || [istarget crisv32-*-*] - || [istarget fido-*-elf] - || [istarget h8300-*-*] - || [istarget lm32-*-*] - || [istarget m32c-*-elf] - || [istarget m68k-*-elf] - || [istarget m68k-*-uclinux*] - || [istarget mep-*-elf] - || [istarget mips*-*-elf*] - || [istarget mmix-*-*] - || [istarget mn10300-*-elf*] - || [istarget moxie-*-elf*] - || [istarget msp430-*-*] - || [istarget nds32*-*-elf] - || [istarget nios2-*-elf] - || [istarget picochip-*-*] - || [istarget powerpc-*-eabi*] - || [istarget powerpc-*-elf] - || [istarget rx-*-*] - || [istarget tic6x-*-elf] - || [istarget xstormy16-*] - || [istarget xtensa*-*-elf] - || [istarget *-*-rtems*] - || [istarget *-*-vxworks*] } { - set profiling_available_saved 0 - } else { - set profiling_available_saved 1 - } - } - - return $profiling_available_saved -} - -# Check to see if a target is "freestanding". This is as per the definition -# in Section 4 of C99 standard. Effectively, it is a target which supports no -# extra headers or libraries other than what is considered essential. -proc check_effective_target_freestanding { } { - if { [istarget picochip-*-*] } then { - return 1 - } else { - return 0 - } -} - -# Return 1 if target has packed layout of structure members by -# default, 0 otherwise. Note that this is slightly different than -# whether the target has "natural alignment": both attributes may be -# false. - -proc check_effective_target_default_packed { } { - return [check_no_compiler_messages default_packed assembly { - struct x { char a; long b; } c; - int s[sizeof (c) == sizeof (char) + sizeof (long) ? 1 : -1]; - }] -} - -# Return 1 if target has PCC_BITFIELD_TYPE_MATTERS defined. See -# documentation, where the test also comes from. - -proc check_effective_target_pcc_bitfield_type_matters { } { - # PCC_BITFIELD_TYPE_MATTERS isn't just about unnamed or empty - # bitfields, but let's stick to the example code from the docs. - return [check_no_compiler_messages pcc_bitfield_type_matters assembly { - struct foo1 { char x; char :0; char y; }; - struct foo2 { char x; int :0; char y; }; - int s[sizeof (struct foo1) != sizeof (struct foo2) ? 1 : -1]; - }] -} - -# Add to FLAGS all the target-specific flags needed to use thread-local storage. - -proc add_options_for_tls { flags } { - # On Solaris 9, __tls_get_addr/___tls_get_addr only lives in - # libthread, so always pass -pthread for native TLS. Same for AIX. - # Need to duplicate native TLS check from - # check_effective_target_tls_native to avoid recursion. - if { ([istarget *-*-solaris2.9*] || [istarget powerpc-ibm-aix*]) && - [check_no_messages_and_pattern tls_native "!emutls" assembly { - __thread int i; - int f (void) { return i; } - void g (int j) { i = j; } - }] } { - return "$flags -pthread" - } - return $flags -} - -# Return 1 if thread local storage (TLS) is supported, 0 otherwise. - -proc check_effective_target_tls {} { - return [check_no_compiler_messages tls assembly { - __thread int i; - int f (void) { return i; } - void g (int j) { i = j; } - }] -} - -# Return 1 if *native* thread local storage (TLS) is supported, 0 otherwise. - -proc check_effective_target_tls_native {} { - # VxWorks uses emulated TLS machinery, but with non-standard helper - # functions, so we fail to automatically detect it. - if { [istarget *-*-vxworks*] } { - return 0 - } - - return [check_no_messages_and_pattern tls_native "!emutls" assembly { - __thread int i; - int f (void) { return i; } - void g (int j) { i = j; } - }] -} - -# Return 1 if *emulated* thread local storage (TLS) is supported, 0 otherwise. - -proc check_effective_target_tls_emulated {} { - # VxWorks uses emulated TLS machinery, but with non-standard helper - # functions, so we fail to automatically detect it. - if { [istarget *-*-vxworks*] } { - return 1 - } - - return [check_no_messages_and_pattern tls_emulated "emutls" assembly { - __thread int i; - int f (void) { return i; } - void g (int j) { i = j; } - }] -} - -# Return 1 if TLS executables can run correctly, 0 otherwise. - -proc check_effective_target_tls_runtime {} { - # MSP430 runtime does not have TLS support, but just - # running the test below is insufficient to show this. - if { [istarget msp430-*-*] } { - return 0 - } - return [check_runtime tls_runtime { - __thread int thr = 0; - int main (void) { return thr; } - } [add_options_for_tls ""]] -} - -# Return 1 if atomic compare-and-swap is supported on 'int' - -proc check_effective_target_cas_char {} { - return [check_no_compiler_messages cas_char assembly { - #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 - #error unsupported - #endif - } ""] -} - -proc check_effective_target_cas_int {} { - return [check_no_compiler_messages cas_int assembly { - #if __INT_MAX__ == 0x7fff && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 - /* ok */ - #elif __INT_MAX__ == 0x7fffffff && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 - /* ok */ - #else - #error unsupported - #endif - } ""] -} - -# Return 1 if -ffunction-sections is supported, 0 otherwise. - -proc check_effective_target_function_sections {} { - # Darwin has its own scheme and silently accepts -ffunction-sections. - if { [istarget *-*-darwin*] } { - return 0 - } - - return [check_no_compiler_messages functionsections assembly { - void foo (void) { } - } "-ffunction-sections"] -} - -# Return 1 if instruction scheduling is available, 0 otherwise. - -proc check_effective_target_scheduling {} { - return [check_no_compiler_messages scheduling object { - void foo (void) { } - } "-fschedule-insns"] -} - -# Return 1 if trapping arithmetic is available, 0 otherwise. - -proc check_effective_target_trapping {} { - return [check_no_compiler_messages scheduling object { - add (int a, int b) { return a + b; } - } "-ftrapv"] -} - -# Return 1 if compilation with -fgraphite is error-free for trivial -# code, 0 otherwise. - -proc check_effective_target_fgraphite {} { - return [check_no_compiler_messages fgraphite object { - void foo (void) { } - } "-O1 -fgraphite"] -} - -# Return 1 if compilation with -fopenmp is error-free for trivial -# code, 0 otherwise. - -proc check_effective_target_fopenmp {} { - return [check_no_compiler_messages fopenmp object { - void foo (void) { } - } "-fopenmp"] -} - -# Return 1 if compilation with -fgnu-tm is error-free for trivial -# code, 0 otherwise. - -proc check_effective_target_fgnu_tm {} { - return [check_no_compiler_messages fgnu_tm object { - void foo (void) { } - } "-fgnu-tm"] -} - -# Return 1 if the target supports mmap, 0 otherwise. - -proc check_effective_target_mmap {} { - return [check_function_available "mmap"] -} - -# Return 1 if the target supports dlopen, 0 otherwise. -proc check_effective_target_dlopen {} { - return [check_no_compiler_messages dlopen executable { - #include - int main(void) { dlopen ("dummy.so", RTLD_NOW); } - } [add_options_for_dlopen ""]] -} - -proc add_options_for_dlopen { flags } { - return "$flags -ldl" -} - -# Return 1 if the target supports clone, 0 otherwise. -proc check_effective_target_clone {} { - return [check_function_available "clone"] -} - -# Return 1 if the target supports setrlimit, 0 otherwise. -proc check_effective_target_setrlimit {} { - # Darwin has non-posix compliant RLIMIT_AS - if { [istarget *-*-darwin*] } { - return 0 - } - return [check_function_available "setrlimit"] -} - -# Return 1 if the target supports swapcontext, 0 otherwise. -proc check_effective_target_swapcontext {} { - return [check_no_compiler_messages swapcontext executable { - #include - int main (void) - { - ucontext_t orig_context,child_context; - if (swapcontext(&child_context, &orig_context) < 0) { } - } - }] -} - -# Return 1 if compilation with -pthread is error-free for trivial -# code, 0 otherwise. - -proc check_effective_target_pthread {} { - return [check_no_compiler_messages pthread object { - void foo (void) { } - } "-pthread"] -} - -# Return 1 if compilation with -mpe-aligned-commons is error-free -# for trivial code, 0 otherwise. - -proc check_effective_target_pe_aligned_commons {} { - if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } { - return [check_no_compiler_messages pe_aligned_commons object { - int foo; - } "-mpe-aligned-commons"] - } - return 0 -} - -# Return 1 if the target supports -static -proc check_effective_target_static {} { - return [check_no_compiler_messages static executable { - int main (void) { return 0; } - } "-static"] -} - -# Return 1 if the target supports -fstack-protector -proc check_effective_target_fstack_protector {} { - return [check_runtime fstack_protector { - int main (void) { return 0; } - } "-fstack-protector"] -} - -# Return 1 if compilation with -freorder-blocks-and-partition is error-free -# for trivial code, 0 otherwise. - -proc check_effective_target_freorder {} { - return [check_no_compiler_messages freorder object { - void foo (void) { } - } "-freorder-blocks-and-partition"] -} - -# Return 1 if -fpic and -fPIC are supported, as in no warnings or errors -# emitted, 0 otherwise. Whether a shared library can actually be built is -# out of scope for this test. - -proc check_effective_target_fpic { } { - # Note that M68K has a multilib that supports -fpic but not - # -fPIC, so we need to check both. We test with a program that - # requires GOT references. - foreach arg {fpic fPIC} { - if [check_no_compiler_messages $arg object { - extern int foo (void); extern int bar; - int baz (void) { return foo () + bar; } - } "-$arg"] { - return 1 - } - } - return 0 -} - -# Return 1 if -pie, -fpie and -fPIE are supported, 0 otherwise. - -proc check_effective_target_pie { } { - if { [istarget *-*-darwin\[912\]*] - || [istarget *-*-linux*] - || [istarget *-*-gnu*] } { - return 1; - } - return 0 -} - -# Return true if the target supports -mpaired-single (as used on MIPS). - -proc check_effective_target_mpaired_single { } { - return [check_no_compiler_messages mpaired_single object { - void foo (void) { } - } "-mpaired-single"] -} - -# Return true if the target has access to FPU instructions. - -proc check_effective_target_hard_float { } { - if { [istarget mips*-*-*] } { - return [check_no_compiler_messages hard_float assembly { - #if (defined __mips_soft_float || defined __mips16) - #error FOO - #endif - }] - } - - # This proc is actually checking the availabilty of FPU - # support for doubles, so on the RX we must fail if the - # 64-bit double multilib has been selected. - if { [istarget rx-*-*] } { - return 0 - # return [check_no_compiler_messages hard_float assembly { - #if defined __RX_64_BIT_DOUBLES__ - #error FOO - #endif - # }] - } - - # The generic test equates hard_float with "no call for adding doubles". - return [check_no_messages_and_pattern hard_float "!\\(call" rtl-expand { - double a (double b, double c) { return b + c; } - }] -} - -# Return true if the target is a 64-bit MIPS target. - -proc check_effective_target_mips64 { } { - return [check_no_compiler_messages mips64 assembly { - #ifndef __mips64 - #error FOO - #endif - }] -} - -# Return true if the target is a MIPS target that does not produce -# MIPS16 code. - -proc check_effective_target_nomips16 { } { - return [check_no_compiler_messages nomips16 object { - #ifndef __mips - #error FOO - #else - /* A cheap way of testing for -mflip-mips16. */ - void foo (void) { asm ("addiu $20,$20,1"); } - void bar (void) { asm ("addiu $20,$20,1"); } - #endif - }] -} - -# Add the options needed for MIPS16 function attributes. At the moment, -# we don't support MIPS16 PIC. - -proc add_options_for_mips16_attribute { flags } { - return "$flags -mno-abicalls -fno-pic -DMIPS16=__attribute__((mips16))" -} - -# Return true if we can force a mode that allows MIPS16 code generation. -# We don't support MIPS16 PIC, and only support MIPS16 -mhard-float -# for o32 and o64. - -proc check_effective_target_mips16_attribute { } { - return [check_no_compiler_messages mips16_attribute assembly { - #ifdef PIC - #error FOO - #endif - #if defined __mips_hard_float \ - && (!defined _ABIO32 || _MIPS_SIM != _ABIO32) \ - && (!defined _ABIO64 || _MIPS_SIM != _ABIO64) - #error FOO - #endif - } [add_options_for_mips16_attribute ""]] -} - -# Return 1 if the target supports long double larger than double when -# using the new ABI, 0 otherwise. - -proc check_effective_target_mips_newabi_large_long_double { } { - return [check_no_compiler_messages mips_newabi_large_long_double object { - int dummy[sizeof(long double) > sizeof(double) ? 1 : -1]; - } "-mabi=64"] -} - -# Return true if the target is a MIPS target that has access -# to the LL and SC instructions. - -proc check_effective_target_mips_llsc { } { - if { ![istarget mips*-*-*] } { - return 0 - } - # Assume that these instructions are always implemented for - # non-elf* targets, via emulation if necessary. - if { ![istarget *-*-elf*] } { - return 1 - } - # Otherwise assume LL/SC support for everything but MIPS I. - return [check_no_compiler_messages mips_llsc assembly { - #if __mips == 1 - #error FOO - #endif - }] -} - -# Return true if the target is a MIPS target that uses in-place relocations. - -proc check_effective_target_mips_rel { } { - if { ![istarget mips*-*-*] } { - return 0 - } - return [check_no_compiler_messages mips_rel object { - #if (defined _ABIN32 && _MIPS_SIM == _ABIN32) \ - || (defined _ABI64 && _MIPS_SIM == _ABI64) - #error FOO - #endif - }] -} - -# Return true if the target is a MIPS target that uses the EABI. - -proc check_effective_target_mips_eabi { } { - if { ![istarget mips*-*-*] } { - return 0 - } - return [check_no_compiler_messages mips_eabi object { - #ifndef __mips_eabi - #error FOO - #endif - }] -} - -# Return 1 if the current multilib does not generate PIC by default. - -proc check_effective_target_nonpic { } { - return [check_no_compiler_messages nonpic assembly { - #if __PIC__ - #error FOO - #endif - }] -} - -# Return 1 if the target does not use a status wrapper. - -proc check_effective_target_unwrapped { } { - if { [target_info needs_status_wrapper] != "" \ - && [target_info needs_status_wrapper] != "0" } { - return 0 - } - return 1 -} - -# Return true if iconv is supported on the target. In particular IBM1047. - -proc check_iconv_available { test_what } { - global libiconv - - # If the tool configuration file has not set libiconv, try "-liconv" - if { ![info exists libiconv] } { - set libiconv "-liconv" - } - set test_what [lindex $test_what 1] - return [check_runtime_nocache $test_what [subst { - #include - int main (void) - { - iconv_t cd; - - cd = iconv_open ("$test_what", "UTF-8"); - if (cd == (iconv_t) -1) - return 1; - return 0; - } - }] $libiconv] -} - -# Return true if Cilk Library is supported on the target. -proc check_libcilkrts_available { } { - return [ check_no_compiler_messages_nocache libcilkrts_available executable { - #ifdef __cplusplus - extern "C" - #endif - int __cilkrts_set_param (const char *, const char *); - int main (void) { - int x = __cilkrts_set_param ("nworkers", "0"); - return x; - } - } "-fcilkplus -lcilkrts" ] -} - -# Return 1 if an ASCII locale is supported on this host, 0 otherwise. - -proc check_ascii_locale_available { } { - return 1 -} - -# Return true if named sections are supported on this target. - -proc check_named_sections_available { } { - return [check_no_compiler_messages named_sections assembly { - int __attribute__ ((section("whatever"))) foo; - }] -} - -# Return true if the "naked" function attribute is supported on this target. - -proc check_effective_target_naked_functions { } { - return [check_no_compiler_messages naked_functions assembly { - void f() __attribute__((naked)); - }] -} - -# Return 1 if the target supports Fortran real kinds larger than real(8), -# 0 otherwise. -# -# When the target name changes, replace the cached result. - -proc check_effective_target_fortran_large_real { } { - return [check_no_compiler_messages fortran_large_real executable { - ! Fortran - integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1) - real(kind=k) :: x - x = cos (x) - end - }] -} - -# Return 1 if the target supports Fortran real kind real(16), -# 0 otherwise. Contrary to check_effective_target_fortran_large_real -# this checks for Real(16) only; the other returned real(10) if -# both real(10) and real(16) are available. -# -# When the target name changes, replace the cached result. - -proc check_effective_target_fortran_real_16 { } { - return [check_no_compiler_messages fortran_real_16 executable { - ! Fortran - real(kind=16) :: x - x = cos (x) - end - }] -} - - -# Return 1 if the target supports SQRT for the largest floating-point -# type. (Some targets lack the libm support for this FP type.) -# On most targets, this check effectively checks either whether sqrtl is -# available or on __float128 systems whether libquadmath is installed, -# which provides sqrtq. -# -# When the target name changes, replace the cached result. - -proc check_effective_target_fortran_largest_fp_has_sqrt { } { - return [check_no_compiler_messages fortran_largest_fp_has_sqrt executable { - ! Fortran - use iso_fortran_env, only: real_kinds - integer,parameter:: maxFP = real_kinds(ubound(real_kinds,dim=1)) - real(kind=maxFP), volatile :: x - x = 2.0_maxFP - x = sqrt (x) - end - }] -} - - -# Return 1 if the target supports Fortran integer kinds larger than -# integer(8), 0 otherwise. -# -# When the target name changes, replace the cached result. - -proc check_effective_target_fortran_large_int { } { - return [check_no_compiler_messages fortran_large_int executable { - ! Fortran - integer,parameter :: k = selected_int_kind (range (0_8) + 1) - integer(kind=k) :: i - end - }] -} - -# Return 1 if the target supports Fortran integer(16), 0 otherwise. -# -# When the target name changes, replace the cached result. - -proc check_effective_target_fortran_integer_16 { } { - return [check_no_compiler_messages fortran_integer_16 executable { - ! Fortran - integer(16) :: i - end - }] -} - -# Return 1 if we can statically link libgfortran, 0 otherwise. -# -# When the target name changes, replace the cached result. - -proc check_effective_target_static_libgfortran { } { - return [check_no_compiler_messages static_libgfortran executable { - ! Fortran - print *, 'test' - end - } "-static"] -} - -# Return 1 if cilk-plus is supported by the target, 0 otherwise. - -proc check_effective_target_cilkplus { } { - # Skip cilk-plus tests on int16 and size16 targets for now. - # The cilk-plus tests are not generic enough to cover these - # cases and would throw hundreds of FAILs. - if { [check_effective_target_int16] - || ![check_effective_target_size32plus] } { - return 0; - } - - # Skip AVR, its RAM is too small and too many tests would fail. - if { [istarget avr-*-*] } { - return 0; - } - return 1 -} - -proc check_linker_plugin_available { } { - return [check_no_compiler_messages_nocache linker_plugin executable { - int main() { return 0; } - } "-flto -fuse-linker-plugin"] -} - -# Return 1 if the target supports executing 750CL paired-single instructions, 0 -# otherwise. Cache the result. - -proc check_750cl_hw_available { } { - return [check_cached_effective_target 750cl_hw_available { - # If this is not the right target then we can skip the test. - if { ![istarget powerpc-*paired*] } { - expr 0 - } else { - check_runtime_nocache 750cl_hw_available { - int main() - { - #ifdef __MACH__ - asm volatile ("ps_mul v0,v0,v0"); - #else - asm volatile ("ps_mul 0,0,0"); - #endif - return 0; - } - } "-mpaired" - } - }] -} - -# Return 1 if the target OS supports running SSE executables, 0 -# otherwise. Cache the result. - -proc check_sse_os_support_available { } { - return [check_cached_effective_target sse_os_support_available { - # If this is not the right target then we can skip the test. - if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { - expr 0 - } elseif { [istarget i?86-*-solaris2*] } { - # The Solaris 2 kernel doesn't save and restore SSE registers - # before Solaris 9 4/04. Before that, executables die with SIGILL. - check_runtime_nocache sse_os_support_available { - int main () - { - asm volatile ("movaps %xmm0,%xmm0"); - return 0; - } - } "-msse" - } else { - expr 1 - } - }] -} - -# Return 1 if the target OS supports running AVX executables, 0 -# otherwise. Cache the result. - -proc check_avx_os_support_available { } { - return [check_cached_effective_target avx_os_support_available { - # If this is not the right target then we can skip the test. - if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { - expr 0 - } else { - # Check that OS has AVX and SSE saving enabled. - check_runtime_nocache avx_os_support_available { - int main () - { - unsigned int eax, edx; - - asm ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0)); - return (eax & 6) != 6; - } - } "" - } - }] -} - -# Return 1 if the target supports executing SSE instructions, 0 -# otherwise. Cache the result. - -proc check_sse_hw_available { } { - return [check_cached_effective_target sse_hw_available { - # If this is not the right target then we can skip the test. - if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { - expr 0 - } else { - check_runtime_nocache sse_hw_available { - #include "cpuid.h" - int main () - { - unsigned int eax, ebx, ecx, edx; - if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) - return !(edx & bit_SSE); - return 1; - } - } "" - } - }] -} - -# Return 1 if the target supports executing SSE2 instructions, 0 -# otherwise. Cache the result. - -proc check_sse2_hw_available { } { - return [check_cached_effective_target sse2_hw_available { - # If this is not the right target then we can skip the test. - if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { - expr 0 - } else { - check_runtime_nocache sse2_hw_available { - #include "cpuid.h" - int main () - { - unsigned int eax, ebx, ecx, edx; - if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) - return !(edx & bit_SSE2); - return 1; - } - } "" - } - }] -} - -# Return 1 if the target supports executing AVX instructions, 0 -# otherwise. Cache the result. - -proc check_avx_hw_available { } { - return [check_cached_effective_target avx_hw_available { - # If this is not the right target then we can skip the test. - if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { - expr 0 - } else { - check_runtime_nocache avx_hw_available { - #include "cpuid.h" - int main () - { - unsigned int eax, ebx, ecx, edx; - if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) - return ((ecx & (bit_AVX | bit_OSXSAVE)) - != (bit_AVX | bit_OSXSAVE)); - return 1; - } - } "" - } - }] -} - -# Return 1 if the target supports running SSE executables, 0 otherwise. - -proc check_effective_target_sse_runtime { } { - if { [check_effective_target_sse] - && [check_sse_hw_available] - && [check_sse_os_support_available] } { - return 1 - } - return 0 -} - -# Return 1 if the target supports running SSE2 executables, 0 otherwise. - -proc check_effective_target_sse2_runtime { } { - if { [check_effective_target_sse2] - && [check_sse2_hw_available] - && [check_sse_os_support_available] } { - return 1 - } - return 0 -} - -# Return 1 if the target supports running AVX executables, 0 otherwise. - -proc check_effective_target_avx_runtime { } { - if { [check_effective_target_avx] - && [check_avx_hw_available] - && [check_avx_os_support_available] } { - return 1 - } - return 0 -} - -# Return 1 if the target supports executing power8 vector instructions, 0 -# otherwise. Cache the result. - -proc check_p8vector_hw_available { } { - return [check_cached_effective_target p8vector_hw_available { - # Some simulators are known to not support VSX/power8 instructions. - # For now, disable on Darwin - if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] || [istarget *-*-darwin*]} { - expr 0 - } else { - set options "-mpower8-vector" - check_runtime_nocache p8vector_hw_available { - int main() - { - #ifdef __MACH__ - asm volatile ("xxlorc vs0,vs0,vs0"); - #else - asm volatile ("xxlorc 0,0,0"); - #endif - return 0; - } - } $options - } - }] -} - -# Return 1 if the target supports executing VSX instructions, 0 -# otherwise. Cache the result. - -proc check_vsx_hw_available { } { - return [check_cached_effective_target vsx_hw_available { - # Some simulators are known to not support VSX instructions. - # For now, disable on Darwin - if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] || [istarget *-*-darwin*]} { - expr 0 - } else { - set options "-mvsx" - check_runtime_nocache vsx_hw_available { - int main() - { - #ifdef __MACH__ - asm volatile ("xxlor vs0,vs0,vs0"); - #else - asm volatile ("xxlor 0,0,0"); - #endif - return 0; - } - } $options - } - }] -} - -# Return 1 if the target supports executing AltiVec instructions, 0 -# otherwise. Cache the result. - -proc check_vmx_hw_available { } { - return [check_cached_effective_target vmx_hw_available { - # Some simulators are known to not support VMX instructions. - if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] } { - expr 0 - } else { - # Most targets don't require special flags for this test case, but - # Darwin does. Just to be sure, make sure VSX is not enabled for - # the altivec tests. - if { [istarget *-*-darwin*] - || [istarget *-*-aix*] } { - set options "-maltivec -mno-vsx" - } else { - set options "-mno-vsx" - } - check_runtime_nocache vmx_hw_available { - int main() - { - #ifdef __MACH__ - asm volatile ("vor v0,v0,v0"); - #else - asm volatile ("vor 0,0,0"); - #endif - return 0; - } - } $options - } - }] -} - -proc check_ppc_recip_hw_available { } { - return [check_cached_effective_target ppc_recip_hw_available { - # Some simulators may not support FRE/FRES/FRSQRTE/FRSQRTES - # For now, disable on Darwin - if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] || [istarget *-*-darwin*]} { - expr 0 - } else { - set options "-mpowerpc-gfxopt -mpowerpc-gpopt -mpopcntb" - check_runtime_nocache ppc_recip_hw_available { - volatile double d_recip, d_rsqrt, d_four = 4.0; - volatile float f_recip, f_rsqrt, f_four = 4.0f; - int main() - { - asm volatile ("fres %0,%1" : "=f" (f_recip) : "f" (f_four)); - asm volatile ("fre %0,%1" : "=d" (d_recip) : "d" (d_four)); - asm volatile ("frsqrtes %0,%1" : "=f" (f_rsqrt) : "f" (f_four)); - asm volatile ("frsqrte %0,%1" : "=f" (d_rsqrt) : "d" (d_four)); - return 0; - } - } $options - } - }] -} - -# Return 1 if the target supports executing AltiVec and Cell PPU -# instructions, 0 otherwise. Cache the result. - -proc check_effective_target_cell_hw { } { - return [check_cached_effective_target cell_hw_available { - # Some simulators are known to not support VMX and PPU instructions. - if { [istarget powerpc-*-eabi*] } { - expr 0 - } else { - # Most targets don't require special flags for this test - # case, but Darwin and AIX do. - if { [istarget *-*-darwin*] - || [istarget *-*-aix*] } { - set options "-maltivec -mcpu=cell" - } else { - set options "-mcpu=cell" - } - check_runtime_nocache cell_hw_available { - int main() - { - #ifdef __MACH__ - asm volatile ("vor v0,v0,v0"); - asm volatile ("lvlx v0,r0,r0"); - #else - asm volatile ("vor 0,0,0"); - asm volatile ("lvlx 0,0,0"); - #endif - return 0; - } - } $options - } - }] -} - -# Return 1 if the target supports executing 64-bit instructions, 0 -# otherwise. Cache the result. - -proc check_effective_target_powerpc64 { } { - global powerpc64_available_saved - global tool - - if [info exists powerpc64_available_saved] { - verbose "check_effective_target_powerpc64 returning saved $powerpc64_available_saved" 2 - } else { - set powerpc64_available_saved 0 - - # Some simulators are known to not support powerpc64 instructions. - if { [istarget powerpc-*-eabi*] || [istarget powerpc-ibm-aix*] } { - verbose "check_effective_target_powerpc64 returning 0" 2 - return $powerpc64_available_saved - } - - # Set up, compile, and execute a test program containing a 64-bit - # instruction. Include the current process ID in the file - # names to prevent conflicts with invocations for multiple - # testsuites. - set src ppc[pid].c - set exe ppc[pid].x - - set f [open $src "w"] - puts $f "int main() {" - puts $f "#ifdef __MACH__" - puts $f " asm volatile (\"extsw r0,r0\");" - puts $f "#else" - puts $f " asm volatile (\"extsw 0,0\");" - puts $f "#endif" - puts $f " return 0; }" - close $f - - set opts "additional_flags=-mcpu=G5" - - verbose "check_effective_target_powerpc64 compiling testfile $src" 2 - set lines [${tool}_target_compile $src $exe executable "$opts"] - file delete $src - - if [string match "" $lines] then { - # No error message, compilation succeeded. - set result [${tool}_load "./$exe" "" ""] - set status [lindex $result 0] - remote_file build delete $exe - verbose "check_effective_target_powerpc64 testfile status is <$status>" 2 - - if { $status == "pass" } then { - set powerpc64_available_saved 1 - } - } else { - verbose "check_effective_target_powerpc64 testfile compilation failed" 2 - } - } - - return $powerpc64_available_saved -} - -# GCC 3.4.0 for powerpc64-*-linux* included an ABI fix for passing -# complex float arguments. This affects gfortran tests that call cabsf -# in libm built by an earlier compiler. Return 1 if libm uses the same -# argument passing as the compiler under test, 0 otherwise. -# -# When the target name changes, replace the cached result. - -proc check_effective_target_broken_cplxf_arg { } { - return [check_cached_effective_target broken_cplxf_arg { - # Skip the work for targets known not to be affected. - if { ![istarget powerpc64-*-linux*] } { - expr 0 - } elseif { ![is-effective-target lp64] } { - expr 0 - } else { - check_runtime_nocache broken_cplxf_arg { - #include - extern void abort (void); - float fabsf (float); - float cabsf (_Complex float); - int main () - { - _Complex float cf; - float f; - cf = 3 + 4.0fi; - f = cabsf (cf); - if (fabsf (f - 5.0) > 0.0001) - abort (); - return 0; - } - } "-lm" - } - }] -} - -# Return 1 is this is a TI C6X target supporting C67X instructions -proc check_effective_target_ti_c67x { } { - return [check_no_compiler_messages ti_c67x assembly { - #if !defined(_TMS320C6700) - #error FOO - #endif - }] -} - -# Return 1 is this is a TI C6X target supporting C64X+ instructions -proc check_effective_target_ti_c64xp { } { - return [check_no_compiler_messages ti_c64xp assembly { - #if !defined(_TMS320C6400_PLUS) - #error FOO - #endif - }] -} - - -proc check_alpha_max_hw_available { } { - return [check_runtime alpha_max_hw_available { - int main() { return __builtin_alpha_amask(1<<8) != 0; } - }] -} - -# Returns true iff the FUNCTION is available on the target system. -# (This is essentially a Tcl implementation of Autoconf's -# AC_CHECK_FUNC.) - -proc check_function_available { function } { - return [check_no_compiler_messages ${function}_available \ - executable [subst { - #ifdef __cplusplus - extern "C" - #endif - char $function (); - int main () { $function (); } - }] "-fno-builtin" ] -} - -# Returns true iff "fork" is available on the target system. - -proc check_fork_available {} { - return [check_function_available "fork"] -} - -# Returns true iff "mkfifo" is available on the target system. - -proc check_mkfifo_available {} { - if { [istarget *-*-cygwin*] } { - # Cygwin has mkfifo, but support is incomplete. - return 0 - } - - return [check_function_available "mkfifo"] -} - -# Returns true iff "__cxa_atexit" is used on the target system. - -proc check_cxa_atexit_available { } { - return [check_cached_effective_target cxa_atexit_available { - if { [istarget hppa*-*-hpux10*] } { - # HP-UX 10 doesn't have __cxa_atexit but subsequent test passes. - expr 0 - } elseif { [istarget *-*-vxworks] } { - # vxworks doesn't have __cxa_atexit but subsequent test passes. - expr 0 - } else { - check_runtime_nocache cxa_atexit_available { - // C++ - #include - static unsigned int count; - struct X - { - X() { count = 1; } - ~X() - { - if (count != 3) - exit(1); - count = 4; - } - }; - void f() - { - static X x; - } - struct Y - { - Y() { f(); count = 2; } - ~Y() - { - if (count != 2) - exit(1); - count = 3; - } - }; - Y y; - int main() { return 0; } - } - } - }] -} - -proc check_effective_target_objc2 { } { - return [check_no_compiler_messages objc2 object { - #ifdef __OBJC2__ - int dummy[1]; - #else - #error - #endif - }] -} - -proc check_effective_target_next_runtime { } { - return [check_no_compiler_messages objc2 object { - #ifdef __NEXT_RUNTIME__ - int dummy[1]; - #else - #error - #endif - }] -} - -# Return 1 if we're generating 32-bit code using default options, 0 -# otherwise. - -proc check_effective_target_ilp32 { } { - return [check_no_compiler_messages ilp32 object { - int dummy[sizeof (int) == 4 - && sizeof (void *) == 4 - && sizeof (long) == 4 ? 1 : -1]; - }] -} - -# Return 1 if we're generating ia32 code using default options, 0 -# otherwise. - -proc check_effective_target_ia32 { } { - return [check_no_compiler_messages ia32 object { - int dummy[sizeof (int) == 4 - && sizeof (void *) == 4 - && sizeof (long) == 4 ? 1 : -1] = { __i386__ }; - }] -} - -# Return 1 if we're generating x32 code using default options, 0 -# otherwise. - -proc check_effective_target_x32 { } { - return [check_no_compiler_messages x32 object { - int dummy[sizeof (int) == 4 - && sizeof (void *) == 4 - && sizeof (long) == 4 ? 1 : -1] = { __x86_64__ }; - }] -} - -# Return 1 if we're generating 32-bit integers using default -# options, 0 otherwise. - -proc check_effective_target_int32 { } { - return [check_no_compiler_messages int32 object { - int dummy[sizeof (int) == 4 ? 1 : -1]; - }] -} - -# Return 1 if we're generating 32-bit or larger integers using default -# options, 0 otherwise. - -proc check_effective_target_int32plus { } { - return [check_no_compiler_messages int32plus object { - int dummy[sizeof (int) >= 4 ? 1 : -1]; - }] -} - -# Return 1 if we're generating 32-bit or larger pointers using default -# options, 0 otherwise. - -proc check_effective_target_ptr32plus { } { - # The msp430 has 16-bit or 20-bit pointers. The 20-bit pointer is stored - # in a 32-bit slot when in memory, so sizeof(void *) returns 4, but it - # cannot really hold a 32-bit address, so we always return false here. - if { [istarget msp430-*-*] } { - return 0 - } - - return [check_no_compiler_messages ptr32plus object { - int dummy[sizeof (void *) >= 4 ? 1 : -1]; - }] -} - -# Return 1 if we support 32-bit or larger array and structure sizes -# using default options, 0 otherwise. - -proc check_effective_target_size32plus { } { - return [check_no_compiler_messages size32plus object { - char dummy[65537]; - }] -} - -# Returns 1 if we're generating 16-bit or smaller integers with the -# default options, 0 otherwise. - -proc check_effective_target_int16 { } { - return [check_no_compiler_messages int16 object { - int dummy[sizeof (int) < 4 ? 1 : -1]; - }] -} - -# Return 1 if we're generating 64-bit code using default options, 0 -# otherwise. - -proc check_effective_target_lp64 { } { - return [check_no_compiler_messages lp64 object { - int dummy[sizeof (int) == 4 - && sizeof (void *) == 8 - && sizeof (long) == 8 ? 1 : -1]; - }] -} - -# Return 1 if we're generating 64-bit code using default llp64 options, -# 0 otherwise. - -proc check_effective_target_llp64 { } { - return [check_no_compiler_messages llp64 object { - int dummy[sizeof (int) == 4 - && sizeof (void *) == 8 - && sizeof (long long) == 8 - && sizeof (long) == 4 ? 1 : -1]; - }] -} - -# Return 1 if long and int have different sizes, -# 0 otherwise. - -proc check_effective_target_long_neq_int { } { - return [check_no_compiler_messages long_ne_int object { - int dummy[sizeof (int) != sizeof (long) ? 1 : -1]; - }] -} - -# Return 1 if the target supports long double larger than double, -# 0 otherwise. - -proc check_effective_target_large_long_double { } { - return [check_no_compiler_messages large_long_double object { - int dummy[sizeof(long double) > sizeof(double) ? 1 : -1]; - }] -} - -# Return 1 if the target supports double larger than float, -# 0 otherwise. - -proc check_effective_target_large_double { } { - return [check_no_compiler_messages large_double object { - int dummy[sizeof(double) > sizeof(float) ? 1 : -1]; - }] -} - -# Return 1 if the target supports double of 64 bits, -# 0 otherwise. - -proc check_effective_target_double64 { } { - return [check_no_compiler_messages double64 object { - int dummy[sizeof(double) == 8 ? 1 : -1]; - }] -} - -# Return 1 if the target supports double of at least 64 bits, -# 0 otherwise. - -proc check_effective_target_double64plus { } { - return [check_no_compiler_messages double64plus object { - int dummy[sizeof(double) >= 8 ? 1 : -1]; - }] -} - -# Return 1 if the target supports 'w' suffix on floating constant -# 0 otherwise. - -proc check_effective_target_has_w_floating_suffix { } { - set opts "" - if [check_effective_target_c++] { - append opts "-std=gnu++03" - } - return [check_no_compiler_messages w_fp_suffix object { - float dummy = 1.0w; - } "$opts"] -} - -# Return 1 if the target supports 'q' suffix on floating constant -# 0 otherwise. - -proc check_effective_target_has_q_floating_suffix { } { - set opts "" - if [check_effective_target_c++] { - append opts "-std=gnu++03" - } - return [check_no_compiler_messages q_fp_suffix object { - float dummy = 1.0q; - } "$opts"] -} -# Return 1 if the target supports compiling fixed-point, -# 0 otherwise. - -proc check_effective_target_fixed_point { } { - return [check_no_compiler_messages fixed_point object { - _Sat _Fract x; _Sat _Accum y; - }] -} - -# Return 1 if the target supports compiling decimal floating point, -# 0 otherwise. - -proc check_effective_target_dfp_nocache { } { - verbose "check_effective_target_dfp_nocache: compiling source" 2 - set ret [check_no_compiler_messages_nocache dfp object { - float x __attribute__((mode(DD))); - }] - verbose "check_effective_target_dfp_nocache: returning $ret" 2 - return $ret -} - -proc check_effective_target_dfprt_nocache { } { - return [check_runtime_nocache dfprt { - typedef float d64 __attribute__((mode(DD))); - d64 x = 1.2df, y = 2.3dd, z; - int main () { z = x + y; return 0; } - }] -} - -# Return 1 if the target supports compiling Decimal Floating Point, -# 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_dfp { } { - return [check_cached_effective_target dfp { - check_effective_target_dfp_nocache - }] -} - -# Return 1 if the target supports linking and executing Decimal Floating -# Point, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_dfprt { } { - return [check_cached_effective_target dfprt { - check_effective_target_dfprt_nocache - }] -} - -# Return 1 if the target supports executing DFP hardware instructions, -# 0 otherwise. Cache the result. - -proc check_dfp_hw_available { } { - return [check_cached_effective_target dfp_hw_available { - # For now, disable on Darwin - if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] || [istarget *-*-darwin*]} { - expr 0 - } else { - check_runtime_nocache dfp_hw_available { - volatile _Decimal64 r; - volatile _Decimal64 a = 4.0DD; - volatile _Decimal64 b = 2.0DD; - int main() - { - asm volatile ("dadd %0,%1,%2" : "=d" (r) : "d" (a), "d" (b)); - asm volatile ("dsub %0,%1,%2" : "=d" (r) : "d" (a), "d" (b)); - asm volatile ("dmul %0,%1,%2" : "=d" (r) : "d" (a), "d" (b)); - asm volatile ("ddiv %0,%1,%2" : "=d" (r) : "d" (a), "d" (b)); - return 0; - } - } "-mcpu=power6 -mhard-float" - } - }] -} - -# Return 1 if the target supports compiling and assembling UCN, 0 otherwise. - -proc check_effective_target_ucn_nocache { } { - # -std=c99 is only valid for C - if [check_effective_target_c] { - set ucnopts "-std=c99" - } - append ucnopts " -fextended-identifiers" - verbose "check_effective_target_ucn_nocache: compiling source" 2 - set ret [check_no_compiler_messages_nocache ucn object { - int \u00C0; - } $ucnopts] - verbose "check_effective_target_ucn_nocache: returning $ret" 2 - return $ret -} - -# Return 1 if the target supports compiling and assembling UCN, 0 otherwise. -# -# This won't change for different subtargets, so cache the result. - -proc check_effective_target_ucn { } { - return [check_cached_effective_target ucn { - check_effective_target_ucn_nocache - }] -} - -# Return 1 if the target needs a command line argument to enable a SIMD -# instruction set. - -proc check_effective_target_vect_cmdline_needed { } { - global et_vect_cmdline_needed_saved - global et_vect_cmdline_needed_target_name - - if { ![info exists et_vect_cmdline_needed_target_name] } { - set et_vect_cmdline_needed_target_name "" - } - - # If the target has changed since we set the cached value, clear it. - set current_target [current_target_name] - if { $current_target != $et_vect_cmdline_needed_target_name } { - verbose "check_effective_target_vect_cmdline_needed: `$et_vect_cmdline_needed_target_name' `$current_target'" 2 - set et_vect_cmdline_needed_target_name $current_target - if { [info exists et_vect_cmdline_needed_saved] } { - verbose "check_effective_target_vect_cmdline_needed: removing cached result" 2 - unset et_vect_cmdline_needed_saved - } - } - - if [info exists et_vect_cmdline_needed_saved] { - verbose "check_effective_target_vect_cmdline_needed: using cached result" 2 - } else { - set et_vect_cmdline_needed_saved 1 - if { [istarget alpha*-*-*] - || [istarget ia64-*-*] - || (([istarget x86_64-*-*] || [istarget i?86-*-*]) - && ([check_effective_target_x32] - || [check_effective_target_lp64])) - || ([istarget powerpc*-*-*] - && ([check_effective_target_powerpc_spe] - || [check_effective_target_powerpc_altivec])) - || ([istarget sparc*-*-*] && [check_effective_target_sparc_vis]) - || [istarget spu-*-*] - || ([istarget arm*-*-*] && [check_effective_target_arm_neon]) - || [istarget aarch64*-*-*] } { - set et_vect_cmdline_needed_saved 0 - } - } - - verbose "check_effective_target_vect_cmdline_needed: returning $et_vect_cmdline_needed_saved" 2 - return $et_vect_cmdline_needed_saved -} - -# Return 1 if the target supports hardware vectors of int, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_int { } { - global et_vect_int_saved - - if [info exists et_vect_int_saved] { - verbose "check_effective_target_vect_int: using cached result" 2 - } else { - set et_vect_int_saved 0 - if { [istarget i?86-*-*] - || ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget spu-*-*] - || [istarget x86_64-*-*] - || [istarget sparc*-*-*] - || [istarget alpha*-*-*] - || [istarget ia64-*-*] - || [istarget aarch64*-*-*] - || [check_effective_target_arm32] - || ([istarget mips*-*-*] - && [check_effective_target_mips_loongson]) } { - set et_vect_int_saved 1 - } - } - - verbose "check_effective_target_vect_int: returning $et_vect_int_saved" 2 - return $et_vect_int_saved -} - -# Return 1 if the target supports signed int->float conversion -# - -proc check_effective_target_vect_intfloat_cvt { } { - global et_vect_intfloat_cvt_saved - - if [info exists et_vect_intfloat_cvt_saved] { - verbose "check_effective_target_vect_intfloat_cvt: using cached result" 2 - } else { - set et_vect_intfloat_cvt_saved 0 - if { [istarget i?86-*-*] - || ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget x86_64-*-*] - || ([istarget arm*-*-*] - && [check_effective_target_arm_neon_ok])} { - set et_vect_intfloat_cvt_saved 1 - } - } - - verbose "check_effective_target_vect_intfloat_cvt: returning $et_vect_intfloat_cvt_saved" 2 - return $et_vect_intfloat_cvt_saved -} - -#Return 1 if we're supporting __int128 for target, 0 otherwise. - -proc check_effective_target_int128 { } { - return [check_no_compiler_messages int128 object { - int dummy[ - #ifndef __SIZEOF_INT128__ - -1 - #else - 1 - #endif - ]; - }] -} - -# Return 1 if the target supports unsigned int->float conversion -# - -proc check_effective_target_vect_uintfloat_cvt { } { - global et_vect_uintfloat_cvt_saved - - if [info exists et_vect_uintfloat_cvt_saved] { - verbose "check_effective_target_vect_uintfloat_cvt: using cached result" 2 - } else { - set et_vect_uintfloat_cvt_saved 0 - if { [istarget i?86-*-*] - || ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget x86_64-*-*] - || [istarget aarch64*-*-*] - || ([istarget arm*-*-*] - && [check_effective_target_arm_neon_ok])} { - set et_vect_uintfloat_cvt_saved 1 - } - } - - verbose "check_effective_target_vect_uintfloat_cvt: returning $et_vect_uintfloat_cvt_saved" 2 - return $et_vect_uintfloat_cvt_saved -} - - -# Return 1 if the target supports signed float->int conversion -# - -proc check_effective_target_vect_floatint_cvt { } { - global et_vect_floatint_cvt_saved - - if [info exists et_vect_floatint_cvt_saved] { - verbose "check_effective_target_vect_floatint_cvt: using cached result" 2 - } else { - set et_vect_floatint_cvt_saved 0 - if { [istarget i?86-*-*] - || ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget x86_64-*-*] - || ([istarget arm*-*-*] - && [check_effective_target_arm_neon_ok])} { - set et_vect_floatint_cvt_saved 1 - } - } - - verbose "check_effective_target_vect_floatint_cvt: returning $et_vect_floatint_cvt_saved" 2 - return $et_vect_floatint_cvt_saved -} - -# Return 1 if the target supports unsigned float->int conversion -# - -proc check_effective_target_vect_floatuint_cvt { } { - global et_vect_floatuint_cvt_saved - - if [info exists et_vect_floatuint_cvt_saved] { - verbose "check_effective_target_vect_floatuint_cvt: using cached result" 2 - } else { - set et_vect_floatuint_cvt_saved 0 - if { ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || ([istarget arm*-*-*] - && [check_effective_target_arm_neon_ok])} { - set et_vect_floatuint_cvt_saved 1 - } - } - - verbose "check_effective_target_vect_floatuint_cvt: returning $et_vect_floatuint_cvt_saved" 2 - return $et_vect_floatuint_cvt_saved -} - -# Return 1 if the target supports #pragma omp declare simd, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_simd_clones { } { - global et_vect_simd_clones_saved - - if [info exists et_vect_simd_clones_saved] { - verbose "check_effective_target_vect_simd_clones: using cached result" 2 - } else { - set et_vect_simd_clones_saved 0 - if { [istarget i?86-*-*] || [istarget x86_64-*-*] } { - # On i?86/x86_64 #pragma omp declare simd builds a sse2, avx and - # avx2 clone. Only the right clone for the specified arch will be - # chosen, but still we need to at least be able to assemble - # avx2. - if { [check_effective_target_avx2] } { - set et_vect_simd_clones_saved 1 - } - } - } - - verbose "check_effective_target_vect_simd_clones: returning $et_vect_simd_clones_saved" 2 - return $et_vect_simd_clones_saved -} - -# Return 1 if this is a AArch64 target supporting big endian -proc check_effective_target_aarch64_big_endian { } { - return [check_no_compiler_messages aarch64_big_endian assembly { - #if !defined(__aarch64__) || !defined(__AARCH64EB__) - #error FOO - #endif - }] -} - -# Return 1 if this is a AArch64 target supporting little endian -proc check_effective_target_aarch64_little_endian { } { - return [check_no_compiler_messages aarch64_little_endian assembly { - #if !defined(__aarch64__) || defined(__AARCH64EB__) - #error FOO - #endif - }] -} - -# Return 1 is this is an arm target using 32-bit instructions -proc check_effective_target_arm32 { } { - return [check_no_compiler_messages arm32 assembly { - #if !defined(__arm__) || (defined(__thumb__) && !defined(__thumb2__)) - #error FOO - #endif - }] -} - -# Return 1 is this is an arm target not using Thumb -proc check_effective_target_arm_nothumb { } { - return [check_no_compiler_messages arm_nothumb assembly { - #if (defined(__thumb__) || defined(__thumb2__)) - #error FOO - #endif - }] -} - -# Return 1 if this is a little-endian ARM target -proc check_effective_target_arm_little_endian { } { - return [check_no_compiler_messages arm_little_endian assembly { - #if !defined(__arm__) || !defined(__ARMEL__) - #error FOO - #endif - }] -} - -# Return 1 if this is an ARM target that only supports aligned vector accesses -proc check_effective_target_arm_vect_no_misalign { } { - return [check_no_compiler_messages arm_vect_no_misalign assembly { - #if !defined(__arm__) \ - || (defined(__ARMEL__) \ - && (!defined(__thumb__) || defined(__thumb2__))) - #error FOO - #endif - }] -} - - -# Return 1 if this is an ARM target supporting -mfpu=vfp -# -mfloat-abi=softfp. Some multilibs may be incompatible with these -# options. - -proc check_effective_target_arm_vfp_ok { } { - if { [check_effective_target_arm32] } { - return [check_no_compiler_messages arm_vfp_ok object { - int dummy; - } "-mfpu=vfp -mfloat-abi=softfp"] - } else { - return 0 - } -} - -# Return 1 if this is an ARM target supporting -mfpu=vfp3 -# -mfloat-abi=softfp. - -proc check_effective_target_arm_vfp3_ok { } { - if { [check_effective_target_arm32] } { - return [check_no_compiler_messages arm_vfp3_ok object { - int dummy; - } "-mfpu=vfp3 -mfloat-abi=softfp"] - } else { - return 0 - } -} - -# Return 1 if this is an ARM target supporting -mfpu=fp-armv8 -# -mfloat-abi=softfp. -proc check_effective_target_arm_v8_vfp_ok {} { - if { [check_effective_target_arm32] } { - return [check_no_compiler_messages arm_v8_vfp_ok object { - int foo (void) - { - __asm__ volatile ("vrinta.f32.f32 s0, s0"); - return 0; - } - } "-mfpu=fp-armv8 -mfloat-abi=softfp"] - } else { - return 0 - } -} - -# Return 1 if this is an ARM target supporting -mfpu=vfp -# -mfloat-abi=hard. Some multilibs may be incompatible with these -# options. - -proc check_effective_target_arm_hard_vfp_ok { } { - if { [check_effective_target_arm32] - && ! [check-flags [list "" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" }]] } { - return [check_no_compiler_messages arm_hard_vfp_ok executable { - int main() { return 0;} - } "-mfpu=vfp -mfloat-abi=hard"] - } else { - return 0 - } -} - -# Return 1 if this is an ARM target that supports DSP multiply with -# current multilib flags. - -proc check_effective_target_arm_dsp { } { - return [check_no_compiler_messages arm_dsp assembly { - #ifndef __ARM_FEATURE_DSP - #error not DSP - #endif - int i; - }] -} - -# Return 1 if this is an ARM target that supports unaligned word/halfword -# load/store instructions. - -proc check_effective_target_arm_unaligned { } { - return [check_no_compiler_messages arm_unaligned assembly { - #ifndef __ARM_FEATURE_UNALIGNED - #error no unaligned support - #endif - int i; - }] -} - -# Return 1 if this is an ARM target supporting -mfpu=crypto-neon-fp-armv8 -# -mfloat-abi=softfp or equivalent options. Some multilibs may be -# incompatible with these options. Also set et_arm_crypto_flags to the -# best options to add. - -proc check_effective_target_arm_crypto_ok_nocache { } { - global et_arm_crypto_flags - set et_arm_crypto_flags "" - if { [check_effective_target_arm32] } { - foreach flags {"" "-mfloat-abi=softfp" "-mfpu=crypto-neon-fp-armv8" "-mfpu=crypto-neon-fp-armv8 -mfloat-abi=softfp"} { - if { [check_no_compiler_messages_nocache arm_crypto_ok object { - #include "arm_neon.h" - uint8x16_t - foo (uint8x16_t a, uint8x16_t b) - { - return vaeseq_u8 (a, b); - } - } "$flags"] } { - set et_arm_crypto_flags $flags - return 1 - } - } - } - - return 0 -} - -# Return 1 if this is an ARM target supporting -mfpu=crypto-neon-fp-armv8 - -proc check_effective_target_arm_crypto_ok { } { - return [check_cached_effective_target arm_crypto_ok \ - check_effective_target_arm_crypto_ok_nocache] -} - -# Add options for crypto extensions. -proc add_options_for_arm_crypto { flags } { - if { ! [check_effective_target_arm_crypto_ok] } { - return "$flags" - } - global et_arm_crypto_flags - return "$flags $et_arm_crypto_flags" -} - -# Add the options needed for NEON. We need either -mfloat-abi=softfp -# or -mfloat-abi=hard, but if one is already specified by the -# multilib, use it. Similarly, if a -mfpu option already enables -# NEON, do not add -mfpu=neon. - -proc add_options_for_arm_neon { flags } { - if { ! [check_effective_target_arm_neon_ok] } { - return "$flags" - } - global et_arm_neon_flags - return "$flags $et_arm_neon_flags" -} - -proc add_options_for_arm_v8_vfp { flags } { - if { ! [check_effective_target_arm_v8_vfp_ok] } { - return "$flags" - } - return "$flags -mfpu=fp-armv8 -mfloat-abi=softfp" -} - -proc add_options_for_arm_v8_neon { flags } { - if { ! [check_effective_target_arm_v8_neon_ok] } { - return "$flags" - } - global et_arm_v8_neon_flags - return "$flags $et_arm_v8_neon_flags -march=armv8-a" -} - -proc add_options_for_arm_crc { flags } { - if { ! [check_effective_target_arm_crc_ok] } { - return "$flags" - } - global et_arm_crc_flags - return "$flags $et_arm_crc_flags" -} - -# Add the options needed for NEON. We need either -mfloat-abi=softfp -# or -mfloat-abi=hard, but if one is already specified by the -# multilib, use it. Similarly, if a -mfpu option already enables -# NEON, do not add -mfpu=neon. - -proc add_options_for_arm_neonv2 { flags } { - if { ! [check_effective_target_arm_neonv2_ok] } { - return "$flags" - } - global et_arm_neonv2_flags - return "$flags $et_arm_neonv2_flags" -} - -# Add the options needed for vfp3. -proc add_options_for_arm_vfp3 { flags } { - if { ! [check_effective_target_arm_vfp3_ok] } { - return "$flags" - } - return "$flags -mfpu=vfp3 -mfloat-abi=softfp" -} - -# Return 1 if this is an ARM target supporting -mfpu=neon -# -mfloat-abi=softfp or equivalent options. Some multilibs may be -# incompatible with these options. Also set et_arm_neon_flags to the -# best options to add. - -proc check_effective_target_arm_neon_ok_nocache { } { - global et_arm_neon_flags - set et_arm_neon_flags "" - if { [check_effective_target_arm32] } { - foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon" "-mfpu=neon -mfloat-abi=softfp"} { - if { [check_no_compiler_messages_nocache arm_neon_ok object { - #include "arm_neon.h" - int dummy; - } "$flags"] } { - set et_arm_neon_flags $flags - return 1 - } - } - } - - return 0 -} - -proc check_effective_target_arm_neon_ok { } { - return [check_cached_effective_target arm_neon_ok \ - check_effective_target_arm_neon_ok_nocache] -} - -proc check_effective_target_arm_crc_ok_nocache { } { - global et_arm_crc_flags - set et_arm_crc_flags "-march=armv8-a+crc" - return [check_no_compiler_messages_nocache arm_crc_ok object { - #if !defined (__ARM_FEATURE_CRC32) - #error FOO - #endif - } "$et_arm_crc_flags"] -} - -proc check_effective_target_arm_crc_ok { } { - return [check_cached_effective_target arm_crc_ok \ - check_effective_target_arm_crc_ok_nocache] -} - -# Return 1 if this is an ARM target supporting -mfpu=neon-fp16 -# -mfloat-abi=softfp or equivalent options. Some multilibs may be -# incompatible with these options. Also set et_arm_neon_flags to the -# best options to add. - -proc check_effective_target_arm_neon_fp16_ok_nocache { } { - global et_arm_neon_fp16_flags - set et_arm_neon_fp16_flags "" - if { [check_effective_target_arm32] } { - foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon-fp16" - "-mfpu=neon-fp16 -mfloat-abi=softfp"} { - if { [check_no_compiler_messages_nocache arm_neon_fp_16_ok object { - #include "arm_neon.h" - float16x4_t - foo (float32x4_t arg) - { - return vcvt_f16_f32 (arg); - } - } "$flags"] } { - set et_arm_neon_fp16_flags $flags - return 1 - } - } - } - - return 0 -} - -proc check_effective_target_arm_neon_fp16_ok { } { - return [check_cached_effective_target arm_neon_fp16_ok \ - check_effective_target_arm_neon_fp16_ok_nocache] -} - -proc add_options_for_arm_neon_fp16 { flags } { - if { ! [check_effective_target_arm_neon_fp16_ok] } { - return "$flags" - } - global et_arm_neon_fp16_flags - return "$flags $et_arm_neon_fp16_flags" -} - -# Return 1 if this is an ARM target supporting -mfpu=neon-fp-armv8 -# -mfloat-abi=softfp or equivalent options. Some multilibs may be -# incompatible with these options. Also set et_arm_v8_neon_flags to the -# best options to add. - -proc check_effective_target_arm_v8_neon_ok_nocache { } { - global et_arm_v8_neon_flags - set et_arm_v8_neon_flags "" - if { [check_effective_target_arm32] } { - foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon-fp-armv8" "-mfpu=neon-fp-armv8 -mfloat-abi=softfp"} { - if { [check_no_compiler_messages_nocache arm_v8_neon_ok object { - #include "arm_neon.h" - void - foo () - { - __asm__ volatile ("vrintn.f32 q0, q0"); - } - } "$flags"] } { - set et_arm_v8_neon_flags $flags - return 1 - } - } - } - - return 0 -} - -proc check_effective_target_arm_v8_neon_ok { } { - return [check_cached_effective_target arm_v8_neon_ok \ - check_effective_target_arm_v8_neon_ok_nocache] -} - -# Return 1 if this is an ARM target supporting -mfpu=neon-vfpv4 -# -mfloat-abi=softfp or equivalent options. Some multilibs may be -# incompatible with these options. Also set et_arm_neonv2_flags to the -# best options to add. - -proc check_effective_target_arm_neonv2_ok_nocache { } { - global et_arm_neonv2_flags - set et_arm_neonv2_flags "" - if { [check_effective_target_arm32] } { - foreach flags {"" "-mfloat-abi=softfp" "-mfpu=neon-vfpv4" "-mfpu=neon-vfpv4 -mfloat-abi=softfp"} { - if { [check_no_compiler_messages_nocache arm_neonv2_ok object { - #include "arm_neon.h" - float32x2_t - foo (float32x2_t a, float32x2_t b, float32x2_t c) - { - return vfma_f32 (a, b, c); - } - } "$flags"] } { - set et_arm_neonv2_flags $flags - return 1 - } - } - } - - return 0 -} - -proc check_effective_target_arm_neonv2_ok { } { - return [check_cached_effective_target arm_neonv2_ok \ - check_effective_target_arm_neonv2_ok_nocache] -} - -# Add the options needed for NEON. We need either -mfloat-abi=softfp -# or -mfloat-abi=hard, but if one is already specified by the -# multilib, use it. - -proc add_options_for_arm_fp16 { flags } { - if { ! [check_effective_target_arm_fp16_ok] } { - return "$flags" - } - global et_arm_fp16_flags - return "$flags $et_arm_fp16_flags" -} - -# Return 1 if this is an ARM target that can support a VFP fp16 variant. -# Skip multilibs that are incompatible with these options and set -# et_arm_fp16_flags to the best options to add. - -proc check_effective_target_arm_fp16_ok_nocache { } { - global et_arm_fp16_flags - set et_arm_fp16_flags "" - if { ! [check_effective_target_arm32] } { - return 0; - } - if [check-flags [list "" { *-*-* } { "-mfpu=*" } { "-mfpu=*fp16*" "-mfpu=*fpv[4-9]*" "-mfpu=*fpv[1-9][0-9]*" } ]] { - # Multilib flags would override -mfpu. - return 0 - } - if [check-flags [list "" { *-*-* } { "-mfloat-abi=soft" } { "" } ]] { - # Must generate floating-point instructions. - return 0 - } - if [check_effective_target_arm_hf_eabi] { - # Use existing float-abi and force an fpu which supports fp16 - set et_arm_fp16_flags "-mfpu=vfpv4" - return 1; - } - if [check-flags [list "" { *-*-* } { "-mfpu=*" } { "" } ]] { - # The existing -mfpu value is OK; use it, but add softfp. - set et_arm_fp16_flags "-mfloat-abi=softfp" - return 1; - } - # Add -mfpu for a VFP fp16 variant since there is no preprocessor - # macro to check for this support. - set flags "-mfpu=vfpv4 -mfloat-abi=softfp" - if { [check_no_compiler_messages_nocache arm_fp16_ok assembly { - int dummy; - } "$flags"] } { - set et_arm_fp16_flags "$flags" - return 1 - } - - return 0 -} - -proc check_effective_target_arm_fp16_ok { } { - return [check_cached_effective_target arm_fp16_ok \ - check_effective_target_arm_fp16_ok_nocache] -} - -# Creates a series of routines that return 1 if the given architecture -# can be selected and a routine to give the flags to select that architecture -# Note: Extra flags may be added to disable options from newer compilers -# (Thumb in particular - but others may be added in the future) -# Usage: /* { dg-require-effective-target arm_arch_v5_ok } */ -# /* { dg-add-options arm_arch_v5 } */ -# /* { dg-require-effective-target arm_arch_v5_multilib } */ -foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__ - v4t "-march=armv4t" __ARM_ARCH_4T__ - v5 "-march=armv5 -marm" __ARM_ARCH_5__ - v5t "-march=armv5t" __ARM_ARCH_5T__ - v5te "-march=armv5te" __ARM_ARCH_5TE__ - v6 "-march=armv6" __ARM_ARCH_6__ - v6k "-march=armv6k" __ARM_ARCH_6K__ - v6t2 "-march=armv6t2" __ARM_ARCH_6T2__ - v6z "-march=armv6z" __ARM_ARCH_6Z__ - v6m "-march=armv6-m -mthumb" __ARM_ARCH_6M__ - v7a "-march=armv7-a" __ARM_ARCH_7A__ - v7ve "-march=armv7ve" __ARM_ARCH_7A__ - v7r "-march=armv7-r" __ARM_ARCH_7R__ - v7m "-march=armv7-m -mthumb" __ARM_ARCH_7M__ - v7em "-march=armv7e-m -mthumb" __ARM_ARCH_7EM__ - v8a "-march=armv8-a" __ARM_ARCH_8A__ } { - eval [string map [list FUNC $armfunc FLAG $armflag DEF $armdef ] { - proc check_effective_target_arm_arch_FUNC_ok { } { - if { [ string match "*-marm*" "FLAG" ] && - ![check_effective_target_arm_arm_ok] } { - return 0 - } - return [check_no_compiler_messages arm_arch_FUNC_ok assembly { - #if !defined (DEF) - #error FOO - #endif - } "FLAG" ] - } - - proc add_options_for_arm_arch_FUNC { flags } { - return "$flags FLAG" - } - - proc check_effective_target_arm_arch_FUNC_multilib { } { - return [check_runtime arm_arch_FUNC_multilib { - int - main (void) - { - return 0; - } - } [add_options_for_arm_arch_FUNC ""]] - } - }] -} - -# Return 1 if this is an ARM target where -marm causes ARM to be -# used (not Thumb) - -proc check_effective_target_arm_arm_ok { } { - return [check_no_compiler_messages arm_arm_ok assembly { - #if !defined (__arm__) || defined (__thumb__) || defined (__thumb2__) - #error FOO - #endif - } "-marm"] -} - - -# Return 1 is this is an ARM target where -mthumb causes Thumb-1 to be -# used. - -proc check_effective_target_arm_thumb1_ok { } { - return [check_no_compiler_messages arm_thumb1_ok assembly { - #if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__) - #error FOO - #endif - } "-mthumb"] -} - -# Return 1 is this is an ARM target where -mthumb causes Thumb-2 to be -# used. - -proc check_effective_target_arm_thumb2_ok { } { - return [check_no_compiler_messages arm_thumb2_ok assembly { - #if !defined(__thumb2__) - #error FOO - #endif - } "-mthumb"] -} - -# Return 1 if this is an ARM target where Thumb-1 is used without options -# added by the test. - -proc check_effective_target_arm_thumb1 { } { - return [check_no_compiler_messages arm_thumb1 assembly { - #if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__) - #error not thumb1 - #endif - int i; - } ""] -} - -# Return 1 if this is an ARM target where Thumb-2 is used without options -# added by the test. - -proc check_effective_target_arm_thumb2 { } { - return [check_no_compiler_messages arm_thumb2 assembly { - #if !defined(__thumb2__) - #error FOO - #endif - int i; - } ""] -} - -# Return 1 if this is an ARM target where conditional execution is available. - -proc check_effective_target_arm_cond_exec { } { - return [check_no_compiler_messages arm_cond_exec assembly { - #if defined(__arm__) && defined(__thumb__) && !defined(__thumb2__) - #error FOO - #endif - int i; - } ""] -} - -# Return 1 if this is an ARM cortex-M profile cpu - -proc check_effective_target_arm_cortex_m { } { - return [check_no_compiler_messages arm_cortex_m assembly { - #if !defined(__ARM_ARCH_7M__) \ - && !defined (__ARM_ARCH_7EM__) \ - && !defined (__ARM_ARCH_6M__) - #error FOO - #endif - int i; - } "-mthumb"] -} - -# Return 1 if the target supports executing NEON instructions, 0 -# otherwise. Cache the result. - -proc check_effective_target_arm_neon_hw { } { - return [check_runtime arm_neon_hw_available { - int - main (void) - { - long long a = 0, b = 1; - asm ("vorr %P0, %P1, %P2" - : "=w" (a) - : "0" (a), "w" (b)); - return (a != 1); - } - } [add_options_for_arm_neon ""]] -} - -proc check_effective_target_arm_neonv2_hw { } { - return [check_runtime arm_neon_hwv2_available { - #include "arm_neon.h" - int - main (void) - { - float32x2_t a, b, c; - asm ("vfma.f32 %P0, %P1, %P2" - : "=w" (a) - : "w" (b), "w" (c)); - return 0; - } - } [add_options_for_arm_neonv2 ""]] -} - -# Return 1 if the target supports executing ARMv8 NEON instructions, 0 -# otherwise. - -proc check_effective_target_arm_v8_neon_hw { } { - return [check_runtime arm_v8_neon_hw_available { - #include "arm_neon.h" - int - main (void) - { - float32x2_t a; - asm ("vrinta.f32 %P0, %P1" - : "=w" (a) - : "0" (a)); - return 0; - } - } [add_options_for_arm_v8_neon ""]] -} - -# Return 1 if this is a ARM target with NEON enabled. - -proc check_effective_target_arm_neon { } { - if { [check_effective_target_arm32] } { - return [check_no_compiler_messages arm_neon object { - #ifndef __ARM_NEON__ - #error not NEON - #else - int dummy; - #endif - }] - } else { - return 0 - } -} - -proc check_effective_target_arm_neonv2 { } { - if { [check_effective_target_arm32] } { - return [check_no_compiler_messages arm_neon object { - #ifndef __ARM_NEON__ - #error not NEON - #else - #ifndef __ARM_FEATURE_FMA - #error not NEONv2 - #else - int dummy; - #endif - #endif - }] - } else { - return 0 - } -} - -# Return 1 if this a Loongson-2E or -2F target using an ABI that supports -# the Loongson vector modes. - -proc check_effective_target_mips_loongson { } { - return [check_no_compiler_messages loongson assembly { - #if !defined(__mips_loongson_vector_rev) - #error FOO - #endif - }] -} - -# Return 1 if this is an ARM target that adheres to the ABI for the ARM -# Architecture. - -proc check_effective_target_arm_eabi { } { - return [check_no_compiler_messages arm_eabi object { - #ifndef __ARM_EABI__ - #error not EABI - #else - int dummy; - #endif - }] -} - -# Return 1 if this is an ARM target that adheres to the hard-float variant of -# the ABI for the ARM Architecture (e.g. -mfloat-abi=hard). - -proc check_effective_target_arm_hf_eabi { } { - return [check_no_compiler_messages arm_hf_eabi object { - #if !defined(__ARM_EABI__) || !defined(__ARM_PCS_VFP) - #error not hard-float EABI - #else - int dummy; - #endif - }] -} - -# Return 1 if this is an ARM target supporting -mcpu=iwmmxt. -# Some multilibs may be incompatible with this option. - -proc check_effective_target_arm_iwmmxt_ok { } { - if { [check_effective_target_arm32] } { - return [check_no_compiler_messages arm_iwmmxt_ok object { - int dummy; - } "-mcpu=iwmmxt"] - } else { - return 0 - } -} - -# Return true if LDRD/STRD instructions are prefered over LDM/STM instructions -# for an ARM target. -proc check_effective_target_arm_prefer_ldrd_strd { } { - if { ![check_effective_target_arm32] } { - return 0; - } - - return [check_no_messages_and_pattern arm_prefer_ldrd_strd "strd\tr" assembly { - void foo (int *p) { p[0] = 1; p[1] = 0;} - } "-O2 -mthumb" ] -} - -# Return 1 if this is a PowerPC target supporting -meabi. - -proc check_effective_target_powerpc_eabi_ok { } { - if { [istarget powerpc*-*-*] } { - return [check_no_compiler_messages powerpc_eabi_ok object { - int dummy; - } "-meabi"] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target with floating-point registers. - -proc check_effective_target_powerpc_fprs { } { - if { [istarget powerpc*-*-*] - || [istarget rs6000-*-*] } { - return [check_no_compiler_messages powerpc_fprs object { - #ifdef __NO_FPRS__ - #error no FPRs - #else - int dummy; - #endif - }] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target with hardware double-precision -# floating point. - -proc check_effective_target_powerpc_hard_double { } { - if { [istarget powerpc*-*-*] - || [istarget rs6000-*-*] } { - return [check_no_compiler_messages powerpc_hard_double object { - #ifdef _SOFT_DOUBLE - #error soft double - #else - int dummy; - #endif - }] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target supporting -maltivec. - -proc check_effective_target_powerpc_altivec_ok { } { - if { ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget rs6000-*-*] } { - # AltiVec is not supported on AIX before 5.3. - if { [istarget powerpc*-*-aix4*] - || [istarget powerpc*-*-aix5.1*] - || [istarget powerpc*-*-aix5.2*] } { - return 0 - } - return [check_no_compiler_messages powerpc_altivec_ok object { - int dummy; - } "-maltivec"] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target supporting -mpower8-vector - -proc check_effective_target_powerpc_p8vector_ok { } { - if { ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget rs6000-*-*] } { - # AltiVec is not supported on AIX before 5.3. - if { [istarget powerpc*-*-aix4*] - || [istarget powerpc*-*-aix5.1*] - || [istarget powerpc*-*-aix5.2*] } { - return 0 - } - return [check_no_compiler_messages powerpc_p8vector_ok object { - int main (void) { -#ifdef __MACH__ - asm volatile ("xxlorc vs0,vs0,vs0"); -#else - asm volatile ("xxlorc 0,0,0"); -#endif - return 0; - } - } "-mpower8-vector"] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target supporting -mvsx - -proc check_effective_target_powerpc_vsx_ok { } { - if { ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget rs6000-*-*] } { - # VSX is not supported on AIX before 7.1. - if { [istarget powerpc*-*-aix4*] - || [istarget powerpc*-*-aix5*] - || [istarget powerpc*-*-aix6*] } { - return 0 - } - return [check_no_compiler_messages powerpc_vsx_ok object { - int main (void) { -#ifdef __MACH__ - asm volatile ("xxlor vs0,vs0,vs0"); -#else - asm volatile ("xxlor 0,0,0"); -#endif - return 0; - } - } "-mvsx"] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target supporting -mhtm - -proc check_effective_target_powerpc_htm_ok { } { - if { ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget rs6000-*-*] } { - # HTM is not supported on AIX yet. - if { [istarget powerpc*-*-aix*] } { - return 0 - } - return [check_no_compiler_messages powerpc_htm_ok object { - int main (void) { - asm volatile ("tbegin. 0"); - return 0; - } - } "-mhtm"] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target supporting -mcpu=cell. - -proc check_effective_target_powerpc_ppu_ok { } { - if [check_effective_target_powerpc_altivec_ok] { - return [check_no_compiler_messages cell_asm_available object { - int main (void) { -#ifdef __MACH__ - asm volatile ("lvlx v0,v0,v0"); -#else - asm volatile ("lvlx 0,0,0"); -#endif - return 0; - } - }] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target that supports SPU. - -proc check_effective_target_powerpc_spu { } { - if { [istarget powerpc*-*-linux*] } { - return [check_effective_target_powerpc_altivec_ok] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC SPE target. The check includes options -# specified by dg-options for this test, so don't cache the result. - -proc check_effective_target_powerpc_spe_nocache { } { - if { [istarget powerpc*-*-*] } { - return [check_no_compiler_messages_nocache powerpc_spe object { - #ifndef __SPE__ - #error not SPE - #else - int dummy; - #endif - } [current_compiler_flags]] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target with SPE enabled. - -proc check_effective_target_powerpc_spe { } { - if { [istarget powerpc*-*-*] } { - return [check_no_compiler_messages powerpc_spe object { - #ifndef __SPE__ - #error not SPE - #else - int dummy; - #endif - }] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target with Altivec enabled. - -proc check_effective_target_powerpc_altivec { } { - if { [istarget powerpc*-*-*] } { - return [check_no_compiler_messages powerpc_altivec object { - #ifndef __ALTIVEC__ - #error not Altivec - #else - int dummy; - #endif - }] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC 405 target. The check includes options -# specified by dg-options for this test, so don't cache the result. - -proc check_effective_target_powerpc_405_nocache { } { - if { [istarget powerpc*-*-*] || [istarget rs6000-*-*] } { - return [check_no_compiler_messages_nocache powerpc_405 object { - #ifdef __PPC405__ - int dummy; - #else - #error not a PPC405 - #endif - } [current_compiler_flags]] - } else { - return 0 - } -} - -# Return 1 if this is a PowerPC target using the ELFv2 ABI. - -proc check_effective_target_powerpc_elfv2 { } { - if { [istarget powerpc*-*-*] } { - return [check_no_compiler_messages powerpc_elfv2 object { - #if _CALL_ELF != 2 - #error not ELF v2 ABI - #else - int dummy; - #endif - }] - } else { - return 0 - } -} - -# Return 1 if this is a SPU target with a toolchain that -# supports automatic overlay generation. - -proc check_effective_target_spu_auto_overlay { } { - if { [istarget spu*-*-elf*] } { - return [check_no_compiler_messages spu_auto_overlay executable { - int main (void) { } - } "-Wl,--auto-overlay" ] - } else { - return 0 - } -} - -# The VxWorks SPARC simulator accepts only EM_SPARC executables and -# chokes on EM_SPARC32PLUS or EM_SPARCV9 executables. Return 1 if the -# test environment appears to run executables on such a simulator. - -proc check_effective_target_ultrasparc_hw { } { - return [check_runtime ultrasparc_hw { - int main() { return 0; } - } "-mcpu=ultrasparc"] -} - -# Return 1 if the test environment supports executing UltraSPARC VIS2 -# instructions. We check this by attempting: "bmask %g0, %g0, %g0" - -proc check_effective_target_ultrasparc_vis2_hw { } { - return [check_runtime ultrasparc_vis2_hw { - int main() { __asm__(".word 0x81b00320"); return 0; } - } "-mcpu=ultrasparc3"] -} - -# Return 1 if the test environment supports executing UltraSPARC VIS3 -# instructions. We check this by attempting: "addxc %g0, %g0, %g0" - -proc check_effective_target_ultrasparc_vis3_hw { } { - return [check_runtime ultrasparc_vis3_hw { - int main() { __asm__(".word 0x81b00220"); return 0; } - } "-mcpu=niagara3"] -} - -# Return 1 if this is a SPARC-V9 target. - -proc check_effective_target_sparc_v9 { } { - if { [istarget sparc*-*-*] } { - return [check_no_compiler_messages sparc_v9 object { - int main (void) { - asm volatile ("return %i7+8"); - return 0; - } - }] - } else { - return 0 - } -} - -# Return 1 if this is a SPARC target with VIS enabled. - -proc check_effective_target_sparc_vis { } { - if { [istarget sparc*-*-*] } { - return [check_no_compiler_messages sparc_vis object { - #ifndef __VIS__ - #error not VIS - #else - int dummy; - #endif - }] - } else { - return 0 - } -} - -# Return 1 if the target supports hardware vector shift operation. - -proc check_effective_target_vect_shift { } { - global et_vect_shift_saved - - if [info exists et_vect_shift_saved] { - verbose "check_effective_target_vect_shift: using cached result" 2 - } else { - set et_vect_shift_saved 0 - if { ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [istarget ia64-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget aarch64*-*-*] - || [check_effective_target_arm32] - || ([istarget mips*-*-*] - && [check_effective_target_mips_loongson]) } { - set et_vect_shift_saved 1 - } - } - - verbose "check_effective_target_vect_shift: returning $et_vect_shift_saved" 2 - return $et_vect_shift_saved -} - -# Return 1 if the target supports hardware vector shift operation for char. - -proc check_effective_target_vect_shift_char { } { - global et_vect_shift_char_saved - - if [info exists et_vect_shift_char_saved] { - verbose "check_effective_target_vect_shift_char: using cached result" 2 - } else { - set et_vect_shift_char_saved 0 - if { ([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - || [check_effective_target_arm32] } { - set et_vect_shift_char_saved 1 - } - } - - verbose "check_effective_target_vect_shift_char: returning $et_vect_shift_char_saved" 2 - return $et_vect_shift_char_saved -} - -# Return 1 if the target supports hardware vectors of long, 0 otherwise. -# -# This can change for different subtargets so do not cache the result. - -proc check_effective_target_vect_long { } { - if { [istarget i?86-*-*] - || (([istarget powerpc*-*-*] - && ![istarget powerpc-*-linux*paired*]) - && [check_effective_target_ilp32]) - || [istarget x86_64-*-*] - || [check_effective_target_arm32] - || ([istarget sparc*-*-*] && [check_effective_target_ilp32]) } { - set answer 1 - } else { - set answer 0 - } - - verbose "check_effective_target_vect_long: returning $answer" 2 - return $answer -} - -# Return 1 if the target supports hardware vectors of float, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_float { } { - global et_vect_float_saved - - if [info exists et_vect_float_saved] { - verbose "check_effective_target_vect_float: using cached result" 2 - } else { - set et_vect_float_saved 0 - if { [istarget i?86-*-*] - || [istarget powerpc*-*-*] - || [istarget spu-*-*] - || [istarget mips-sde-elf] - || [istarget mipsisa64*-*-*] - || [istarget x86_64-*-*] - || [istarget ia64-*-*] - || [istarget aarch64*-*-*] - || [check_effective_target_arm32] } { - set et_vect_float_saved 1 - } - } - - verbose "check_effective_target_vect_float: returning $et_vect_float_saved" 2 - return $et_vect_float_saved -} - -# Return 1 if the target supports hardware vectors of double, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_double { } { - global et_vect_double_saved - - if [info exists et_vect_double_saved] { - verbose "check_effective_target_vect_double: using cached result" 2 - } else { - set et_vect_double_saved 0 - if { [istarget i?86-*-*] - || [istarget aarch64*-*-*] - || [istarget x86_64-*-*] } { - if { [check_no_compiler_messages vect_double assembly { - #ifdef __tune_atom__ - # error No double vectorizer support. - #endif - }] } { - set et_vect_double_saved 1 - } else { - set et_vect_double_saved 0 - } - } elseif { [istarget spu-*-*] } { - set et_vect_double_saved 1 - } - } - - verbose "check_effective_target_vect_double: returning $et_vect_double_saved" 2 - return $et_vect_double_saved -} - -# Return 1 if the target supports hardware vectors of long long, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_long_long { } { - global et_vect_long_long_saved - - if [info exists et_vect_long_long_saved] { - verbose "check_effective_target_vect_long_long: using cached result" 2 - } else { - set et_vect_long_long_saved 0 - if { [istarget i?86-*-*] - || [istarget x86_64-*-*] } { - set et_vect_long_long_saved 1 - } - } - - verbose "check_effective_target_vect_long_long: returning $et_vect_long_long_saved" 2 - return $et_vect_long_long_saved -} - - -# Return 1 if the target plus current options does not support a vector -# max instruction on "int", 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_no_int_max { } { - global et_vect_no_int_max_saved - - if [info exists et_vect_no_int_max_saved] { - verbose "check_effective_target_vect_no_int_max: using cached result" 2 - } else { - set et_vect_no_int_max_saved 0 - if { [istarget sparc*-*-*] - || [istarget spu-*-*] - || [istarget alpha*-*-*] - || ([istarget mips*-*-*] - && [check_effective_target_mips_loongson]) } { - set et_vect_no_int_max_saved 1 - } - } - verbose "check_effective_target_vect_no_int_max: returning $et_vect_no_int_max_saved" 2 - return $et_vect_no_int_max_saved -} - -# Return 1 if the target plus current options does not support a vector -# add instruction on "int", 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_no_int_add { } { - global et_vect_no_int_add_saved - - if [info exists et_vect_no_int_add_saved] { - verbose "check_effective_target_vect_no_int_add: using cached result" 2 - } else { - set et_vect_no_int_add_saved 0 - # Alpha only supports vector add on V8QI and V4HI. - if { [istarget alpha*-*-*] } { - set et_vect_no_int_add_saved 1 - } - } - verbose "check_effective_target_vect_no_int_add: returning $et_vect_no_int_add_saved" 2 - return $et_vect_no_int_add_saved -} - -# Return 1 if the target plus current options does not support vector -# bitwise instructions, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_no_bitwise { } { - global et_vect_no_bitwise_saved - - if [info exists et_vect_no_bitwise_saved] { - verbose "check_effective_target_vect_no_bitwise: using cached result" 2 - } else { - set et_vect_no_bitwise_saved 0 - } - verbose "check_effective_target_vect_no_bitwise: returning $et_vect_no_bitwise_saved" 2 - return $et_vect_no_bitwise_saved -} - -# Return 1 if the target plus current options supports vector permutation, -# 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_perm { } { - global et_vect_perm - - if [info exists et_vect_perm_saved] { - verbose "check_effective_target_vect_perm: using cached result" 2 - } else { - set et_vect_perm_saved 0 - if { [is-effective-target arm_neon_ok] - || ([istarget aarch64*-*-*] - && [is-effective-target aarch64_little_endian]) - || [istarget powerpc*-*-*] - || [istarget spu-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || ([istarget mips*-*-*] - && [check_effective_target_mpaired_single]) } { - set et_vect_perm_saved 1 - } - } - verbose "check_effective_target_vect_perm: returning $et_vect_perm_saved" 2 - return $et_vect_perm_saved -} - -# Return 1 if the target plus current options supports vector permutation -# on byte-sized elements, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_perm_byte { } { - global et_vect_perm_byte - - if [info exists et_vect_perm_byte_saved] { - verbose "check_effective_target_vect_perm_byte: using cached result" 2 - } else { - set et_vect_perm_byte_saved 0 - if { ([is-effective-target arm_neon_ok] - && [is-effective-target arm_little_endian]) - || ([istarget aarch64*-*-*] - && [is-effective-target aarch64_little_endian]) - || [istarget powerpc*-*-*] - || [istarget spu-*-*] } { - set et_vect_perm_byte_saved 1 - } - } - verbose "check_effective_target_vect_perm_byte: returning $et_vect_perm_byte_saved" 2 - return $et_vect_perm_byte_saved -} - -# Return 1 if the target plus current options supports vector permutation -# on short-sized elements, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_perm_short { } { - global et_vect_perm_short - - if [info exists et_vect_perm_short_saved] { - verbose "check_effective_target_vect_perm_short: using cached result" 2 - } else { - set et_vect_perm_short_saved 0 - if { ([is-effective-target arm_neon_ok] - && [is-effective-target arm_little_endian]) - || ([istarget aarch64*-*-*] - && [is-effective-target aarch64_little_endian]) - || [istarget powerpc*-*-*] - || [istarget spu-*-*] } { - set et_vect_perm_short_saved 1 - } - } - verbose "check_effective_target_vect_perm_short: returning $et_vect_perm_short_saved" 2 - return $et_vect_perm_short_saved -} - -# Return 1 if the target plus current options supports a vector -# widening summation of *short* args into *int* result, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_sum_hi_to_si_pattern { } { - global et_vect_widen_sum_hi_to_si_pattern - - if [info exists et_vect_widen_sum_hi_to_si_pattern_saved] { - verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern: using cached result" 2 - } else { - set et_vect_widen_sum_hi_to_si_pattern_saved 0 - if { [istarget powerpc*-*-*] - || [istarget ia64-*-*] } { - set et_vect_widen_sum_hi_to_si_pattern_saved 1 - } - } - verbose "check_effective_target_vect_widen_sum_hi_to_si_pattern: returning $et_vect_widen_sum_hi_to_si_pattern_saved" 2 - return $et_vect_widen_sum_hi_to_si_pattern_saved -} - -# Return 1 if the target plus current options supports a vector -# widening summation of *short* args into *int* result, 0 otherwise. -# A target can also support this widening summation if it can support -# promotion (unpacking) from shorts to ints. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_sum_hi_to_si { } { - global et_vect_widen_sum_hi_to_si - - if [info exists et_vect_widen_sum_hi_to_si_saved] { - verbose "check_effective_target_vect_widen_sum_hi_to_si: using cached result" 2 - } else { - set et_vect_widen_sum_hi_to_si_saved [check_effective_target_vect_unpack] - if { [istarget powerpc*-*-*] - || [istarget ia64-*-*] } { - set et_vect_widen_sum_hi_to_si_saved 1 - } - } - verbose "check_effective_target_vect_widen_sum_hi_to_si: returning $et_vect_widen_sum_hi_to_si_saved" 2 - return $et_vect_widen_sum_hi_to_si_saved -} - -# Return 1 if the target plus current options supports a vector -# widening summation of *char* args into *short* result, 0 otherwise. -# A target can also support this widening summation if it can support -# promotion (unpacking) from chars to shorts. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_sum_qi_to_hi { } { - global et_vect_widen_sum_qi_to_hi - - if [info exists et_vect_widen_sum_qi_to_hi_saved] { - verbose "check_effective_target_vect_widen_sum_qi_to_hi: using cached result" 2 - } else { - set et_vect_widen_sum_qi_to_hi_saved 0 - if { [check_effective_target_vect_unpack] - || [check_effective_target_arm_neon_ok] - || [istarget ia64-*-*] } { - set et_vect_widen_sum_qi_to_hi_saved 1 - } - } - verbose "check_effective_target_vect_widen_sum_qi_to_hi: returning $et_vect_widen_sum_qi_to_hi_saved" 2 - return $et_vect_widen_sum_qi_to_hi_saved -} - -# Return 1 if the target plus current options supports a vector -# widening summation of *char* args into *int* result, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_sum_qi_to_si { } { - global et_vect_widen_sum_qi_to_si - - if [info exists et_vect_widen_sum_qi_to_si_saved] { - verbose "check_effective_target_vect_widen_sum_qi_to_si: using cached result" 2 - } else { - set et_vect_widen_sum_qi_to_si_saved 0 - if { [istarget powerpc*-*-*] } { - set et_vect_widen_sum_qi_to_si_saved 1 - } - } - verbose "check_effective_target_vect_widen_sum_qi_to_si: returning $et_vect_widen_sum_qi_to_si_saved" 2 - return $et_vect_widen_sum_qi_to_si_saved -} - -# Return 1 if the target plus current options supports a vector -# widening multiplication of *char* args into *short* result, 0 otherwise. -# A target can also support this widening multplication if it can support -# promotion (unpacking) from chars to shorts, and vect_short_mult (non-widening -# multiplication of shorts). -# -# This won't change for different subtargets so cache the result. - - -proc check_effective_target_vect_widen_mult_qi_to_hi { } { - global et_vect_widen_mult_qi_to_hi - - if [info exists et_vect_widen_mult_qi_to_hi_saved] { - verbose "check_effective_target_vect_widen_mult_qi_to_hi: using cached result" 2 - } else { - if { [check_effective_target_vect_unpack] - && [check_effective_target_vect_short_mult] } { - set et_vect_widen_mult_qi_to_hi_saved 1 - } else { - set et_vect_widen_mult_qi_to_hi_saved 0 - } - if { [istarget powerpc*-*-*] - || [istarget aarch64*-*-*] - || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } { - set et_vect_widen_mult_qi_to_hi_saved 1 - } - } - verbose "check_effective_target_vect_widen_mult_qi_to_hi: returning $et_vect_widen_mult_qi_to_hi_saved" 2 - return $et_vect_widen_mult_qi_to_hi_saved -} - -# Return 1 if the target plus current options supports a vector -# widening multiplication of *short* args into *int* result, 0 otherwise. -# A target can also support this widening multplication if it can support -# promotion (unpacking) from shorts to ints, and vect_int_mult (non-widening -# multiplication of ints). -# -# This won't change for different subtargets so cache the result. - - -proc check_effective_target_vect_widen_mult_hi_to_si { } { - global et_vect_widen_mult_hi_to_si - - if [info exists et_vect_widen_mult_hi_to_si_saved] { - verbose "check_effective_target_vect_widen_mult_hi_to_si: using cached result" 2 - } else { - if { [check_effective_target_vect_unpack] - && [check_effective_target_vect_int_mult] } { - set et_vect_widen_mult_hi_to_si_saved 1 - } else { - set et_vect_widen_mult_hi_to_si_saved 0 - } - if { [istarget powerpc*-*-*] - || [istarget spu-*-*] - || [istarget ia64-*-*] - || [istarget aarch64*-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } { - set et_vect_widen_mult_hi_to_si_saved 1 - } - } - verbose "check_effective_target_vect_widen_mult_hi_to_si: returning $et_vect_widen_mult_hi_to_si_saved" 2 - return $et_vect_widen_mult_hi_to_si_saved -} - -# Return 1 if the target plus current options supports a vector -# widening multiplication of *char* args into *short* result, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_mult_qi_to_hi_pattern { } { - global et_vect_widen_mult_qi_to_hi_pattern - - if [info exists et_vect_widen_mult_qi_to_hi_pattern_saved] { - verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern: using cached result" 2 - } else { - set et_vect_widen_mult_qi_to_hi_pattern_saved 0 - if { [istarget powerpc*-*-*] - || ([istarget arm*-*-*] - && [check_effective_target_arm_neon_ok] - && [check_effective_target_arm_little_endian]) } { - set et_vect_widen_mult_qi_to_hi_pattern_saved 1 - } - } - verbose "check_effective_target_vect_widen_mult_qi_to_hi_pattern: returning $et_vect_widen_mult_qi_to_hi_pattern_saved" 2 - return $et_vect_widen_mult_qi_to_hi_pattern_saved -} - -# Return 1 if the target plus current options supports a vector -# widening multiplication of *short* args into *int* result, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_mult_hi_to_si_pattern { } { - global et_vect_widen_mult_hi_to_si_pattern - - if [info exists et_vect_widen_mult_hi_to_si_pattern_saved] { - verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern: using cached result" 2 - } else { - set et_vect_widen_mult_hi_to_si_pattern_saved 0 - if { [istarget powerpc*-*-*] - || [istarget spu-*-*] - || [istarget ia64-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || ([istarget arm*-*-*] - && [check_effective_target_arm_neon_ok] - && [check_effective_target_arm_little_endian]) } { - set et_vect_widen_mult_hi_to_si_pattern_saved 1 - } - } - verbose "check_effective_target_vect_widen_mult_hi_to_si_pattern: returning $et_vect_widen_mult_hi_to_si_pattern_saved" 2 - return $et_vect_widen_mult_hi_to_si_pattern_saved -} - -# Return 1 if the target plus current options supports a vector -# widening multiplication of *int* args into *long* result, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_mult_si_to_di_pattern { } { - global et_vect_widen_mult_si_to_di_pattern - - if [info exists et_vect_widen_mult_si_to_di_pattern_saved] { - verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: using cached result" 2 - } else { - set et_vect_widen_mult_si_to_di_pattern_saved 0 - if {[istarget ia64-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] } { - set et_vect_widen_mult_si_to_di_pattern_saved 1 - } - } - verbose "check_effective_target_vect_widen_mult_si_to_di_pattern: returning $et_vect_widen_mult_si_to_di_pattern_saved" 2 - return $et_vect_widen_mult_si_to_di_pattern_saved -} - -# Return 1 if the target plus current options supports a vector -# widening shift, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_widen_shift { } { - global et_vect_widen_shift_saved - - if [info exists et_vect_shift_saved] { - verbose "check_effective_target_vect_widen_shift: using cached result" 2 - } else { - set et_vect_widen_shift_saved 0 - if { ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } { - set et_vect_widen_shift_saved 1 - } - } - verbose "check_effective_target_vect_widen_shift: returning $et_vect_widen_shift_saved" 2 - return $et_vect_widen_shift_saved -} - -# Return 1 if the target plus current options supports a vector -# dot-product of signed chars, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_sdot_qi { } { - global et_vect_sdot_qi - - if [info exists et_vect_sdot_qi_saved] { - verbose "check_effective_target_vect_sdot_qi: using cached result" 2 - } else { - set et_vect_sdot_qi_saved 0 - if { [istarget ia64-*-*] } { - set et_vect_udot_qi_saved 1 - } - } - verbose "check_effective_target_vect_sdot_qi: returning $et_vect_sdot_qi_saved" 2 - return $et_vect_sdot_qi_saved -} - -# Return 1 if the target plus current options supports a vector -# dot-product of unsigned chars, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_udot_qi { } { - global et_vect_udot_qi - - if [info exists et_vect_udot_qi_saved] { - verbose "check_effective_target_vect_udot_qi: using cached result" 2 - } else { - set et_vect_udot_qi_saved 0 - if { [istarget powerpc*-*-*] - || [istarget ia64-*-*] } { - set et_vect_udot_qi_saved 1 - } - } - verbose "check_effective_target_vect_udot_qi: returning $et_vect_udot_qi_saved" 2 - return $et_vect_udot_qi_saved -} - -# Return 1 if the target plus current options supports a vector -# dot-product of signed shorts, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_sdot_hi { } { - global et_vect_sdot_hi - - if [info exists et_vect_sdot_hi_saved] { - verbose "check_effective_target_vect_sdot_hi: using cached result" 2 - } else { - set et_vect_sdot_hi_saved 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) - || [istarget ia64-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] } { - set et_vect_sdot_hi_saved 1 - } - } - verbose "check_effective_target_vect_sdot_hi: returning $et_vect_sdot_hi_saved" 2 - return $et_vect_sdot_hi_saved -} - -# Return 1 if the target plus current options supports a vector -# dot-product of unsigned shorts, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_udot_hi { } { - global et_vect_udot_hi - - if [info exists et_vect_udot_hi_saved] { - verbose "check_effective_target_vect_udot_hi: using cached result" 2 - } else { - set et_vect_udot_hi_saved 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) } { - set et_vect_udot_hi_saved 1 - } - } - verbose "check_effective_target_vect_udot_hi: returning $et_vect_udot_hi_saved" 2 - return $et_vect_udot_hi_saved -} - - -# Return 1 if the target plus current options supports a vector -# demotion (packing) of shorts (to chars) and ints (to shorts) -# using modulo arithmetic, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_pack_trunc { } { - global et_vect_pack_trunc - - if [info exists et_vect_pack_trunc_saved] { - verbose "check_effective_target_vect_pack_trunc: using cached result" 2 - } else { - set et_vect_pack_trunc_saved 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget aarch64*-*-*] - || [istarget spu-*-*] - || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok] - && [check_effective_target_arm_little_endian]) } { - set et_vect_pack_trunc_saved 1 - } - } - verbose "check_effective_target_vect_pack_trunc: returning $et_vect_pack_trunc_saved" 2 - return $et_vect_pack_trunc_saved -} - -# Return 1 if the target plus current options supports a vector -# promotion (unpacking) of chars (to shorts) and shorts (to ints), 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_unpack { } { - global et_vect_unpack - - if [info exists et_vect_unpack_saved] { - verbose "check_effective_target_vect_unpack: using cached result" 2 - } else { - set et_vect_unpack_saved 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*paired*]) - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget spu-*-*] - || [istarget ia64-*-*] - || [istarget aarch64*-*-*] - || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok] - && [check_effective_target_arm_little_endian]) } { - set et_vect_unpack_saved 1 - } - } - verbose "check_effective_target_vect_unpack: returning $et_vect_unpack_saved" 2 - return $et_vect_unpack_saved -} - -# Return 1 if the target plus current options does not guarantee -# that its STACK_BOUNDARY is >= the reguired vector alignment. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_unaligned_stack { } { - global et_unaligned_stack_saved - - if [info exists et_unaligned_stack_saved] { - verbose "check_effective_target_unaligned_stack: using cached result" 2 - } else { - set et_unaligned_stack_saved 0 - } - verbose "check_effective_target_unaligned_stack: returning $et_unaligned_stack_saved" 2 - return $et_unaligned_stack_saved -} - -# Return 1 if the target plus current options does not support a vector -# alignment mechanism, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_no_align { } { - global et_vect_no_align_saved - - if [info exists et_vect_no_align_saved] { - verbose "check_effective_target_vect_no_align: using cached result" 2 - } else { - set et_vect_no_align_saved 0 - if { [istarget mipsisa64*-*-*] - || [istarget mips-sde-elf] - || [istarget sparc*-*-*] - || [istarget ia64-*-*] - || [check_effective_target_arm_vect_no_misalign] - || ([istarget mips*-*-*] - && [check_effective_target_mips_loongson]) } { - set et_vect_no_align_saved 1 - } - } - verbose "check_effective_target_vect_no_align: returning $et_vect_no_align_saved" 2 - return $et_vect_no_align_saved -} - -# Return 1 if the target supports a vector misalign access, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_hw_misalign { } { - global et_vect_hw_misalign_saved - - if [info exists et_vect_hw_misalign_saved] { - verbose "check_effective_target_vect_hw_misalign: using cached result" 2 - } else { - set et_vect_hw_misalign_saved 0 - if { ([istarget x86_64-*-*] - || [istarget aarch64*-*-*] - || [istarget i?86-*-*]) } { - set et_vect_hw_misalign_saved 1 - } - } - verbose "check_effective_target_vect_hw_misalign: returning $et_vect_hw_misalign_saved" 2 - return $et_vect_hw_misalign_saved -} - - -# Return 1 if arrays are aligned to the vector alignment -# boundary, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_aligned_arrays { } { - global et_vect_aligned_arrays - - if [info exists et_vect_aligned_arrays_saved] { - verbose "check_effective_target_vect_aligned_arrays: using cached result" 2 - } else { - set et_vect_aligned_arrays_saved 0 - if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } { - if { ([is-effective-target lp64] - && ( ![check_avx_available] - || [check_prefer_avx128])) } { - set et_vect_aligned_arrays_saved 1 - } - } - if [istarget spu-*-*] { - set et_vect_aligned_arrays_saved 1 - } - } - verbose "check_effective_target_vect_aligned_arrays: returning $et_vect_aligned_arrays_saved" 2 - return $et_vect_aligned_arrays_saved -} - -# Return 1 if types of size 32 bit or less are naturally aligned -# (aligned to their type-size), 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_natural_alignment_32 { } { - global et_natural_alignment_32 - - if [info exists et_natural_alignment_32_saved] { - verbose "check_effective_target_natural_alignment_32: using cached result" 2 - } else { - # FIXME: 32bit powerpc: guaranteed only if MASK_ALIGN_NATURAL/POWER. - set et_natural_alignment_32_saved 1 - if { ([istarget *-*-darwin*] && [is-effective-target lp64]) } { - set et_natural_alignment_32_saved 0 - } - } - verbose "check_effective_target_natural_alignment_32: returning $et_natural_alignment_32_saved" 2 - return $et_natural_alignment_32_saved -} - -# Return 1 if types of size 64 bit or less are naturally aligned (aligned to their -# type-size), 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_natural_alignment_64 { } { - global et_natural_alignment_64 - - if [info exists et_natural_alignment_64_saved] { - verbose "check_effective_target_natural_alignment_64: using cached result" 2 - } else { - set et_natural_alignment_64_saved 0 - if { ([is-effective-target lp64] && ![istarget *-*-darwin*]) - || [istarget spu-*-*] } { - set et_natural_alignment_64_saved 1 - } - } - verbose "check_effective_target_natural_alignment_64: returning $et_natural_alignment_64_saved" 2 - return $et_natural_alignment_64_saved -} - -# Return 1 if all vector types are naturally aligned (aligned to their -# type-size), 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vect_natural_alignment { } { - global et_vect_natural_alignment - - if [info exists et_vect_natural_alignment_saved] { - verbose "check_effective_target_vect_natural_alignment: using cached result" 2 - } else { - set et_vect_natural_alignment_saved 1 - if { [check_effective_target_arm_eabi] } { - set et_vect_natural_alignment_saved 0 - } - } - verbose "check_effective_target_vect_natural_alignment: returning $et_vect_natural_alignment_saved" 2 - return $et_vect_natural_alignment_saved -} - -# Return 1 if vector alignment (for types of size 32 bit or less) is reachable, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vector_alignment_reachable { } { - global et_vector_alignment_reachable - - if [info exists et_vector_alignment_reachable_saved] { - verbose "check_effective_target_vector_alignment_reachable: using cached result" 2 - } else { - if { [check_effective_target_vect_aligned_arrays] - || [check_effective_target_natural_alignment_32] } { - set et_vector_alignment_reachable_saved 1 - } else { - set et_vector_alignment_reachable_saved 0 - } - } - verbose "check_effective_target_vector_alignment_reachable: returning $et_vector_alignment_reachable_saved" 2 - return $et_vector_alignment_reachable_saved -} - -# Return 1 if vector alignment for 64 bit is reachable, 0 otherwise. -# -# This won't change for different subtargets so cache the result. - -proc check_effective_target_vector_alignment_reachable_for_64bit { } { - global et_vector_alignment_reachable_for_64bit - - if [info exists et_vector_alignment_reachable_for_64bit_saved] { - verbose "check_effective_target_vector_alignment_reachable_for_64bit: using cached result" 2 - } else { - if { [check_effective_target_vect_aligned_arrays] - || [check_effective_target_natural_alignment_64] } { - set et_vector_alignment_reachable_for_64bit_saved 1 - } else { - set et_vector_alignment_reachable_for_64bit_saved 0 - } - } - verbose "check_effective_target_vector_alignment_reachable_for_64bit: returning $et_vector_alignment_reachable_for_64bit_saved" 2 - return $et_vector_alignment_reachable_for_64bit_saved -} - -# Return 1 if the target only requires element alignment for vector accesses - -proc check_effective_target_vect_element_align { } { - global et_vect_element_align - - if [info exists et_vect_element_align] { - verbose "check_effective_target_vect_element_align: using cached result" 2 - } else { - set et_vect_element_align 0 - if { ([istarget arm*-*-*] - && ![check_effective_target_arm_vect_no_misalign]) - || [check_effective_target_vect_hw_misalign] } { - set et_vect_element_align 1 - } - } - - verbose "check_effective_target_vect_element_align: returning $et_vect_element_align" 2 - return $et_vect_element_align -} - -# Return 1 if the target supports vector conditional operations, 0 otherwise. - -proc check_effective_target_vect_condition { } { - global et_vect_cond_saved - - if [info exists et_vect_cond_saved] { - verbose "check_effective_target_vect_cond: using cached result" 2 - } else { - set et_vect_cond_saved 0 - if { [istarget aarch64*-*-*] - || [istarget powerpc*-*-*] - || [istarget ia64-*-*] - || [istarget i?86-*-*] - || [istarget spu-*-*] - || [istarget x86_64-*-*] - || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok]) } { - set et_vect_cond_saved 1 - } - } - - verbose "check_effective_target_vect_cond: returning $et_vect_cond_saved" 2 - return $et_vect_cond_saved -} - -# Return 1 if the target supports vector conditional operations where -# the comparison has different type from the lhs, 0 otherwise. - -proc check_effective_target_vect_cond_mixed { } { - global et_vect_cond_mixed_saved - - if [info exists et_vect_cond_mixed_saved] { - verbose "check_effective_target_vect_cond_mixed: using cached result" 2 - } else { - set et_vect_cond_mixed_saved 0 - if { [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget powerpc*-*-*] } { - set et_vect_cond_mixed_saved 1 - } - } - - verbose "check_effective_target_vect_cond_mixed: returning $et_vect_cond_mixed_saved" 2 - return $et_vect_cond_mixed_saved -} - -# Return 1 if the target supports vector char multiplication, 0 otherwise. - -proc check_effective_target_vect_char_mult { } { - global et_vect_char_mult_saved - - if [info exists et_vect_char_mult_saved] { - verbose "check_effective_target_vect_char_mult: using cached result" 2 - } else { - set et_vect_char_mult_saved 0 - if { [istarget aarch64*-*-*] - || [istarget ia64-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [check_effective_target_arm32] } { - set et_vect_char_mult_saved 1 - } - } - - verbose "check_effective_target_vect_char_mult: returning $et_vect_char_mult_saved" 2 - return $et_vect_char_mult_saved -} - -# Return 1 if the target supports vector short multiplication, 0 otherwise. - -proc check_effective_target_vect_short_mult { } { - global et_vect_short_mult_saved - - if [info exists et_vect_short_mult_saved] { - verbose "check_effective_target_vect_short_mult: using cached result" 2 - } else { - set et_vect_short_mult_saved 0 - if { [istarget ia64-*-*] - || [istarget spu-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget powerpc*-*-*] - || [istarget aarch64*-*-*] - || [check_effective_target_arm32] - || ([istarget mips*-*-*] - && [check_effective_target_mips_loongson]) } { - set et_vect_short_mult_saved 1 - } - } - - verbose "check_effective_target_vect_short_mult: returning $et_vect_short_mult_saved" 2 - return $et_vect_short_mult_saved -} - -# Return 1 if the target supports vector int multiplication, 0 otherwise. - -proc check_effective_target_vect_int_mult { } { - global et_vect_int_mult_saved - - if [info exists et_vect_int_mult_saved] { - verbose "check_effective_target_vect_int_mult: using cached result" 2 - } else { - set et_vect_int_mult_saved 0 - if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*]) - || [istarget spu-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget ia64-*-*] - || [istarget aarch64*-*-*] - || [check_effective_target_arm32] } { - set et_vect_int_mult_saved 1 - } - } - - verbose "check_effective_target_vect_int_mult: returning $et_vect_int_mult_saved" 2 - return $et_vect_int_mult_saved -} - -# Return 1 if the target supports vector even/odd elements extraction, 0 otherwise. - -proc check_effective_target_vect_extract_even_odd { } { - global et_vect_extract_even_odd_saved - - if [info exists et_vect_extract_even_odd_saved] { - verbose "check_effective_target_vect_extract_even_odd: using cached result" 2 - } else { - set et_vect_extract_even_odd_saved 0 - if { [istarget aarch64*-*-*] - || [istarget powerpc*-*-*] - || [is-effective-target arm_neon_ok] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget ia64-*-*] - || [istarget spu-*-*] - || ([istarget mips*-*-*] - && [check_effective_target_mpaired_single]) } { - set et_vect_extract_even_odd_saved 1 - } - } - - verbose "check_effective_target_vect_extract_even_odd: returning $et_vect_extract_even_odd_saved" 2 - return $et_vect_extract_even_odd_saved -} - -# Return 1 if the target supports vector interleaving, 0 otherwise. - -proc check_effective_target_vect_interleave { } { - global et_vect_interleave_saved - - if [info exists et_vect_interleave_saved] { - verbose "check_effective_target_vect_interleave: using cached result" 2 - } else { - set et_vect_interleave_saved 0 - if { [istarget aarch64*-*-*] - || [istarget powerpc*-*-*] - || [is-effective-target arm_neon_ok] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget ia64-*-*] - || [istarget spu-*-*] - || ([istarget mips*-*-*] - && [check_effective_target_mpaired_single]) } { - set et_vect_interleave_saved 1 - } - } - - verbose "check_effective_target_vect_interleave: returning $et_vect_interleave_saved" 2 - return $et_vect_interleave_saved -} - -foreach N {2 3 4 8} { - eval [string map [list N $N] { - # Return 1 if the target supports 2-vector interleaving - proc check_effective_target_vect_stridedN { } { - global et_vect_stridedN_saved - - if [info exists et_vect_stridedN_saved] { - verbose "check_effective_target_vect_stridedN: using cached result" 2 - } else { - set et_vect_stridedN_saved 0 - if { (N & -N) == N - && [check_effective_target_vect_interleave] - && [check_effective_target_vect_extract_even_odd] } { - set et_vect_stridedN_saved 1 - } - if { ([istarget arm*-*-*] - || [istarget aarch64*-*-*]) && N >= 2 && N <= 4 } { - set et_vect_stridedN_saved 1 - } - } - - verbose "check_effective_target_vect_stridedN: returning $et_vect_stridedN_saved" 2 - return $et_vect_stridedN_saved - } - }] -} - -# Return 1 if the target supports multiple vector sizes - -proc check_effective_target_vect_multiple_sizes { } { - global et_vect_multiple_sizes_saved - - set et_vect_multiple_sizes_saved 0 - if { ([istarget aarch64*-*-*] - || ([istarget arm*-*-*] && [check_effective_target_arm_neon_ok])) } { - set et_vect_multiple_sizes_saved 1 - } - if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } { - if { ([check_avx_available] && ![check_prefer_avx128]) } { - set et_vect_multiple_sizes_saved 1 - } - } - - verbose "check_effective_target_vect_multiple_sizes: returning $et_vect_multiple_sizes_saved" 2 - return $et_vect_multiple_sizes_saved -} - -# Return 1 if the target supports vectors of 64 bits. - -proc check_effective_target_vect64 { } { - global et_vect64_saved - - if [info exists et_vect64_saved] { - verbose "check_effective_target_vect64: using cached result" 2 - } else { - set et_vect64_saved 0 - if { ([istarget arm*-*-*] - && [check_effective_target_arm_neon_ok] - && [check_effective_target_arm_little_endian]) } { - set et_vect64_saved 1 - } - } - - verbose "check_effective_target_vect64: returning $et_vect64_saved" 2 - return $et_vect64_saved -} - -# Return 1 if the target supports vector copysignf calls. - -proc check_effective_target_vect_call_copysignf { } { - global et_vect_call_copysignf_saved - - if [info exists et_vect_call_copysignf_saved] { - verbose "check_effective_target_vect_call_copysignf: using cached result" 2 - } else { - set et_vect_call_copysignf_saved 0 - if { [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget powerpc*-*-*] } { - set et_vect_call_copysignf_saved 1 - } - } - - verbose "check_effective_target_vect_call_copysignf: returning $et_vect_call_copysignf_saved" 2 - return $et_vect_call_copysignf_saved -} - -# Return 1 if the target supports vector sqrtf calls. - -proc check_effective_target_vect_call_sqrtf { } { - global et_vect_call_sqrtf_saved - - if [info exists et_vect_call_sqrtf_saved] { - verbose "check_effective_target_vect_call_sqrtf: using cached result" 2 - } else { - set et_vect_call_sqrtf_saved 0 - if { [istarget aarch64*-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || ([istarget powerpc*-*-*] && [check_vsx_hw_available]) } { - set et_vect_call_sqrtf_saved 1 - } - } - - verbose "check_effective_target_vect_call_sqrtf: returning $et_vect_call_sqrtf_saved" 2 - return $et_vect_call_sqrtf_saved -} - -# Return 1 if the target supports vector lrint calls. - -proc check_effective_target_vect_call_lrint { } { - set et_vect_call_lrint 0 - if { ([istarget i?86-*-*] || [istarget x86_64-*-*]) && [check_effective_target_ilp32] } { - set et_vect_call_lrint 1 - } - - verbose "check_effective_target_vect_call_lrint: returning $et_vect_call_lrint" 2 - return $et_vect_call_lrint -} - -# Return 1 if the target supports vector btrunc calls. - -proc check_effective_target_vect_call_btrunc { } { - global et_vect_call_btrunc_saved - - if [info exists et_vect_call_btrunc_saved] { - verbose "check_effective_target_vect_call_btrunc: using cached result" 2 - } else { - set et_vect_call_btrunc_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_btrunc_saved 1 - } - } - - verbose "check_effective_target_vect_call_btrunc: returning $et_vect_call_btrunc_saved" 2 - return $et_vect_call_btrunc_saved -} - -# Return 1 if the target supports vector btruncf calls. - -proc check_effective_target_vect_call_btruncf { } { - global et_vect_call_btruncf_saved - - if [info exists et_vect_call_btruncf_saved] { - verbose "check_effective_target_vect_call_btruncf: using cached result" 2 - } else { - set et_vect_call_btruncf_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_btruncf_saved 1 - } - } - - verbose "check_effective_target_vect_call_btruncf: returning $et_vect_call_btruncf_saved" 2 - return $et_vect_call_btruncf_saved -} - -# Return 1 if the target supports vector ceil calls. - -proc check_effective_target_vect_call_ceil { } { - global et_vect_call_ceil_saved - - if [info exists et_vect_call_ceil_saved] { - verbose "check_effective_target_vect_call_ceil: using cached result" 2 - } else { - set et_vect_call_ceil_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_ceil_saved 1 - } - } - - verbose "check_effective_target_vect_call_ceil: returning $et_vect_call_ceil_saved" 2 - return $et_vect_call_ceil_saved -} - -# Return 1 if the target supports vector ceilf calls. - -proc check_effective_target_vect_call_ceilf { } { - global et_vect_call_ceilf_saved - - if [info exists et_vect_call_ceilf_saved] { - verbose "check_effective_target_vect_call_ceilf: using cached result" 2 - } else { - set et_vect_call_ceilf_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_ceilf_saved 1 - } - } - - verbose "check_effective_target_vect_call_ceilf: returning $et_vect_call_ceilf_saved" 2 - return $et_vect_call_ceilf_saved -} - -# Return 1 if the target supports vector floor calls. - -proc check_effective_target_vect_call_floor { } { - global et_vect_call_floor_saved - - if [info exists et_vect_call_floor_saved] { - verbose "check_effective_target_vect_call_floor: using cached result" 2 - } else { - set et_vect_call_floor_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_floor_saved 1 - } - } - - verbose "check_effective_target_vect_call_floor: returning $et_vect_call_floor_saved" 2 - return $et_vect_call_floor_saved -} - -# Return 1 if the target supports vector floorf calls. - -proc check_effective_target_vect_call_floorf { } { - global et_vect_call_floorf_saved - - if [info exists et_vect_call_floorf_saved] { - verbose "check_effective_target_vect_call_floorf: using cached result" 2 - } else { - set et_vect_call_floorf_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_floorf_saved 1 - } - } - - verbose "check_effective_target_vect_call_floorf: returning $et_vect_call_floorf_saved" 2 - return $et_vect_call_floorf_saved -} - -# Return 1 if the target supports vector lceil calls. - -proc check_effective_target_vect_call_lceil { } { - global et_vect_call_lceil_saved - - if [info exists et_vect_call_lceil_saved] { - verbose "check_effective_target_vect_call_lceil: using cached result" 2 - } else { - set et_vect_call_lceil_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_lceil_saved 1 - } - } - - verbose "check_effective_target_vect_call_lceil: returning $et_vect_call_lceil_saved" 2 - return $et_vect_call_lceil_saved -} - -# Return 1 if the target supports vector lfloor calls. - -proc check_effective_target_vect_call_lfloor { } { - global et_vect_call_lfloor_saved - - if [info exists et_vect_call_lfloor_saved] { - verbose "check_effective_target_vect_call_lfloor: using cached result" 2 - } else { - set et_vect_call_lfloor_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_lfloor_saved 1 - } - } - - verbose "check_effective_target_vect_call_lfloor: returning $et_vect_call_lfloor_saved" 2 - return $et_vect_call_lfloor_saved -} - -# Return 1 if the target supports vector nearbyint calls. - -proc check_effective_target_vect_call_nearbyint { } { - global et_vect_call_nearbyint_saved - - if [info exists et_vect_call_nearbyint_saved] { - verbose "check_effective_target_vect_call_nearbyint: using cached result" 2 - } else { - set et_vect_call_nearbyint_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_nearbyint_saved 1 - } - } - - verbose "check_effective_target_vect_call_nearbyint: returning $et_vect_call_nearbyint_saved" 2 - return $et_vect_call_nearbyint_saved -} - -# Return 1 if the target supports vector nearbyintf calls. - -proc check_effective_target_vect_call_nearbyintf { } { - global et_vect_call_nearbyintf_saved - - if [info exists et_vect_call_nearbyintf_saved] { - verbose "check_effective_target_vect_call_nearbyintf: using cached result" 2 - } else { - set et_vect_call_nearbyintf_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_nearbyintf_saved 1 - } - } - - verbose "check_effective_target_vect_call_nearbyintf: returning $et_vect_call_nearbyintf_saved" 2 - return $et_vect_call_nearbyintf_saved -} - -# Return 1 if the target supports vector round calls. - -proc check_effective_target_vect_call_round { } { - global et_vect_call_round_saved - - if [info exists et_vect_call_round_saved] { - verbose "check_effective_target_vect_call_round: using cached result" 2 - } else { - set et_vect_call_round_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_round_saved 1 - } - } - - verbose "check_effective_target_vect_call_round: returning $et_vect_call_round_saved" 2 - return $et_vect_call_round_saved -} - -# Return 1 if the target supports vector roundf calls. - -proc check_effective_target_vect_call_roundf { } { - global et_vect_call_roundf_saved - - if [info exists et_vect_call_roundf_saved] { - verbose "check_effective_target_vect_call_roundf: using cached result" 2 - } else { - set et_vect_call_roundf_saved 0 - if { [istarget aarch64*-*-*] } { - set et_vect_call_roundf_saved 1 - } - } - - verbose "check_effective_target_vect_call_roundf: returning $et_vect_call_roundf_saved" 2 - return $et_vect_call_roundf_saved -} - -# Return 1 if the target supports section-anchors - -proc check_effective_target_section_anchors { } { - global et_section_anchors_saved - - if [info exists et_section_anchors_saved] { - verbose "check_effective_target_section_anchors: using cached result" 2 - } else { - set et_section_anchors_saved 0 - if { [istarget powerpc*-*-*] - || [istarget arm*-*-*] } { - set et_section_anchors_saved 1 - } - } - - verbose "check_effective_target_section_anchors: returning $et_section_anchors_saved" 2 - return $et_section_anchors_saved -} - -# Return 1 if the target supports atomic operations on "int_128" values. - -proc check_effective_target_sync_int_128 { } { - if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) - && ![is-effective-target ia32] } { - return 1 - } else { - return 0 - } -} - -# Return 1 if the target supports atomic operations on "int_128" values -# and can execute them. - -proc check_effective_target_sync_int_128_runtime { } { - if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) - && ![is-effective-target ia32] } { - return [check_cached_effective_target sync_int_128_available { - check_runtime_nocache sync_int_128_available { - #include "cpuid.h" - int main () - { - unsigned int eax, ebx, ecx, edx; - if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) - return !(ecx & bit_CMPXCHG16B); - return 1; - } - } "" - }] - } else { - return 0 - } -} - -# Return 1 if the target supports atomic operations on "long long". -# -# Note: 32bit x86 targets require -march=pentium in dg-options. - -proc check_effective_target_sync_long_long { } { - if { [istarget x86_64-*-*] - || [istarget i?86-*-*]) - || [istarget aarch64*-*-*] - || [istarget arm*-*-*] - || [istarget alpha*-*-*] - || ([istarget sparc*-*-*] && [check_effective_target_lp64]) } { - return 1 - } else { - return 0 - } -} - -# Return 1 if the target supports atomic operations on "long long" -# and can execute them. -# -# Note: 32bit x86 targets require -march=pentium in dg-options. - -proc check_effective_target_sync_long_long_runtime { } { - if { [istarget x86_64-*-*] - || [istarget i?86-*-*] } { - return [check_cached_effective_target sync_long_long_available { - check_runtime_nocache sync_long_long_available { - #include "cpuid.h" - int main () - { - unsigned int eax, ebx, ecx, edx; - if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) - return !(edx & bit_CMPXCHG8B); - return 1; - } - } "" - }] - } elseif { [istarget aarch64*-*-*] } { - return 1 - } elseif { [istarget arm*-*-linux-*] } { - return [check_runtime sync_longlong_runtime { - #include - int main () - { - long long l1; - - if (sizeof (long long) != 8) - exit (1); - - /* Just check for native; checking for kernel fallback is tricky. */ - asm volatile ("ldrexd r0,r1, [%0]" : : "r" (&l1) : "r0", "r1"); - - exit (0); - } - } "" ] - } elseif { [istarget alpha*-*-*] } { - return 1 - } elseif { ([istarget sparc*-*-*] - && [check_effective_target_lp64] - && [check_effective_target_ultrasparc_hw]) } { - return 1 - } elseif { [istarget powerpc*-*-*] && [check_effective_target_lp64] } { - return 1 - } else { - return 0 - } -} - -# Return 1 if the target supports atomic operations on "int" and "long". - -proc check_effective_target_sync_int_long { } { - global et_sync_int_long_saved - - if [info exists et_sync_int_long_saved] { - verbose "check_effective_target_sync_int_long: using cached result" 2 - } else { - set et_sync_int_long_saved 0 -# This is intentionally powerpc but not rs6000, rs6000 doesn't have the -# load-reserved/store-conditional instructions. - if { [istarget ia64-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget aarch64*-*-*] - || [istarget alpha*-*-*] - || [istarget arm*-*-linux-*] - || [istarget bfin*-*linux*] - || [istarget hppa*-*linux*] - || [istarget s390*-*-*] - || [istarget powerpc*-*-*] - || [istarget crisv32-*-*] || [istarget cris-*-*] - || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9]) - || [check_effective_target_mips_llsc] } { - set et_sync_int_long_saved 1 - } - } - - verbose "check_effective_target_sync_int_long: returning $et_sync_int_long_saved" 2 - return $et_sync_int_long_saved -} - -# Return 1 if the target supports atomic operations on "char" and "short". - -proc check_effective_target_sync_char_short { } { - global et_sync_char_short_saved - - if [info exists et_sync_char_short_saved] { - verbose "check_effective_target_sync_char_short: using cached result" 2 - } else { - set et_sync_char_short_saved 0 -# This is intentionally powerpc but not rs6000, rs6000 doesn't have the -# load-reserved/store-conditional instructions. - if { [istarget aarch64*-*-*] - || [istarget ia64-*-*] - || [istarget i?86-*-*] - || [istarget x86_64-*-*] - || [istarget alpha*-*-*] - || [istarget arm*-*-linux-*] - || [istarget hppa*-*linux*] - || [istarget s390*-*-*] - || [istarget powerpc*-*-*] - || [istarget crisv32-*-*] || [istarget cris-*-*] - || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9]) - || [check_effective_target_mips_llsc] } { - set et_sync_char_short_saved 1 - } - } - - verbose "check_effective_target_sync_char_short: returning $et_sync_char_short_saved" 2 - return $et_sync_char_short_saved -} - -# Return 1 if the target uses a ColdFire FPU. - -proc check_effective_target_coldfire_fpu { } { - return [check_no_compiler_messages coldfire_fpu assembly { - #ifndef __mcffpu__ - #error FOO - #endif - }] -} - -# Return true if this is a uClibc target. - -proc check_effective_target_uclibc {} { - return [check_no_compiler_messages uclibc object { - #include - #if !defined (__UCLIBC__) - #error FOO - #endif - }] -} - -# Return true if this is a uclibc target and if the uclibc feature -# described by __$feature__ is not present. - -proc check_missing_uclibc_feature {feature} { - return [check_no_compiler_messages $feature object " - #include - #if !defined (__UCLIBC) || defined (__${feature}__) - #error FOO - #endif - "] -} - -# Return true if this is a Newlib target. - -proc check_effective_target_newlib {} { - return [check_no_compiler_messages newlib object { - #include - }] -} - -# Return true if this is NOT a Bionic target. - -proc check_effective_target_non_bionic {} { - return [check_no_compiler_messages non_bionic object { - #include - #if defined (__BIONIC__) - #error FOO - #endif - }] -} - -# Return 1 if -# (a) an error of a few ULP is expected in string to floating-point -# conversion functions; and -# (b) overflow is not always detected correctly by those functions. - -proc check_effective_target_lax_strtofp {} { - # By default, assume that all uClibc targets suffer from this. - return [check_effective_target_uclibc] -} - -# Return 1 if this is a target for which wcsftime is a dummy -# function that always returns 0. - -proc check_effective_target_dummy_wcsftime {} { - # By default, assume that all uClibc targets suffer from this. - return [check_effective_target_uclibc] -} - -# Return 1 if constructors with initialization priority arguments are -# supposed on this target. - -proc check_effective_target_init_priority {} { - return [check_no_compiler_messages init_priority assembly " - void f() __attribute__((constructor (1000))); - void f() \{\} - "] -} - -# Return 1 if the target matches the effective target 'arg', 0 otherwise. -# This can be used with any check_* proc that takes no argument and -# returns only 1 or 0. It could be used with check_* procs that take -# arguments with keywords that pass particular arguments. - -proc is-effective-target { arg } { - set selected 0 - if { [info procs check_effective_target_${arg}] != [list] } { - set selected [check_effective_target_${arg}] - } else { - switch $arg { - "vmx_hw" { set selected [check_vmx_hw_available] } - "vsx_hw" { set selected [check_vsx_hw_available] } - "p8vector_hw" { set selected [check_p8vector_hw_available] } - "ppc_recip_hw" { set selected [check_ppc_recip_hw_available] } - "dfp_hw" { set selected [check_dfp_hw_available] } - "named_sections" { set selected [check_named_sections_available] } - "gc_sections" { set selected [check_gc_sections_available] } - "cxa_atexit" { set selected [check_cxa_atexit_available] } - default { error "unknown effective target keyword `$arg'" } - } - } - verbose "is-effective-target: $arg $selected" 2 - return $selected -} - -# Return 1 if the argument is an effective-target keyword, 0 otherwise. - -proc is-effective-target-keyword { arg } { - if { [info procs check_effective_target_${arg}] != [list] } { - return 1 - } else { - # These have different names for their check_* procs. - switch $arg { - "vmx_hw" { return 1 } - "vsx_hw" { return 1 } - "p8vector_hw" { return 1 } - "ppc_recip_hw" { return 1 } - "dfp_hw" { return 1 } - "named_sections" { return 1 } - "gc_sections" { return 1 } - "cxa_atexit" { return 1 } - default { return 0 } - } - } -} - -# Return 1 if target default to short enums - -proc check_effective_target_short_enums { } { - return [check_no_compiler_messages short_enums assembly { - enum foo { bar }; - int s[sizeof (enum foo) == 1 ? 1 : -1]; - }] -} - -# Return 1 if target supports merging string constants at link time. - -proc check_effective_target_string_merging { } { - return [check_no_messages_and_pattern string_merging \ - "rodata\\.str" assembly { - const char *var = "String"; - } {-O2}] -} - -# Return 1 if target has the basic signed and unsigned types in -# , 0 otherwise. This will be obsolete when GCC ensures a -# working for all targets. - -proc check_effective_target_stdint_types { } { - return [check_no_compiler_messages stdint_types assembly { - #include - int8_t a; int16_t b; int32_t c; int64_t d; - uint8_t e; uint16_t f; uint32_t g; uint64_t h; - }] -} - -# Return 1 if target has the basic signed and unsigned types in -# , 0 otherwise. This is for tests that GCC's notions of -# these types agree with those in the header, as some systems have -# only . - -proc check_effective_target_inttypes_types { } { - return [check_no_compiler_messages inttypes_types assembly { - #include - int8_t a; int16_t b; int32_t c; int64_t d; - uint8_t e; uint16_t f; uint32_t g; uint64_t h; - }] -} - -# Return 1 if programs are intended to be run on a simulator -# (i.e. slowly) rather than hardware (i.e. fast). - -proc check_effective_target_simulator { } { - - # All "src/sim" simulators set this one. - if [board_info target exists is_simulator] { - return [board_info target is_simulator] - } - - # The "sid" simulators don't set that one, but at least they set - # this one. - if [board_info target exists slow_simulator] { - return [board_info target slow_simulator] - } - - return 0 -} - -# Return 1 if programs are intended to be run on hardware rather than -# on a simulator - -proc check_effective_target_hw { } { - - # All "src/sim" simulators set this one. - if [board_info target exists is_simulator] { - if [board_info target is_simulator] { - return 0 - } else { - return 1 - } - } - - # The "sid" simulators don't set that one, but at least they set - # this one. - if [board_info target exists slow_simulator] { - if [board_info target slow_simulator] { - return 0 - } else { - return 1 - } - } - - return 1 -} - -# Return 1 if the target is a VxWorks kernel. - -proc check_effective_target_vxworks_kernel { } { - return [check_no_compiler_messages vxworks_kernel assembly { - #if !defined __vxworks || defined __RTP__ - #error NO - #endif - }] -} - -# Return 1 if the target is a VxWorks RTP. - -proc check_effective_target_vxworks_rtp { } { - return [check_no_compiler_messages vxworks_rtp assembly { - #if !defined __vxworks || !defined __RTP__ - #error NO - #endif - }] -} - -# Return 1 if the target is expected to provide wide character support. - -proc check_effective_target_wchar { } { - if {[check_missing_uclibc_feature UCLIBC_HAS_WCHAR]} { - return 0 - } - return [check_no_compiler_messages wchar assembly { - #include - }] -} - -# Return 1 if the target has . - -proc check_effective_target_pthread_h { } { - return [check_no_compiler_messages pthread_h assembly { - #include - }] -} - -# Return 1 if the target can truncate a file from a file-descriptor, -# as used by libgfortran/io/unix.c:fd_truncate; i.e. ftruncate or -# chsize. We test for a trivially functional truncation; no stubs. -# As libgfortran uses _FILE_OFFSET_BITS 64, we do too; it'll cause a -# different function to be used. - -proc check_effective_target_fd_truncate { } { - set prog { - #define _FILE_OFFSET_BITS 64 - #include - #include - #include - int main () - { - FILE *f = fopen ("tst.tmp", "wb"); - int fd; - const char t[] = "test writing more than ten characters"; - char s[11]; - int status = 0; - fd = fileno (f); - write (fd, t, sizeof (t) - 1); - lseek (fd, 0, 0); - if (ftruncate (fd, 10) != 0) - status = 1; - close (fd); - fclose (f); - if (status) - { - unlink ("tst.tmp"); - exit (status); - } - f = fopen ("tst.tmp", "rb"); - if (fread (s, 1, sizeof (s), f) != 10 || strncmp (s, t, 10) != 0) - status = 1; - fclose (f); - unlink ("tst.tmp"); - exit (status); - } - } - - if { [check_runtime ftruncate $prog] } { - return 1; - } - - regsub "ftruncate" $prog "chsize" prog - return [check_runtime chsize $prog] -} - -# Add to FLAGS all the target-specific flags needed to access the c99 runtime. - -proc add_options_for_c99_runtime { flags } { - if { [istarget *-*-solaris2*] } { - return "$flags -std=c99" - } - if { [istarget powerpc-*-darwin*] } { - return "$flags -mmacosx-version-min=10.3" - } - return $flags -} - -# Add to FLAGS all the target-specific flags needed to enable -# full IEEE compliance mode. - -proc add_options_for_ieee { flags } { - if { [istarget alpha*-*-*] - || [istarget sh*-*-*] } { - return "$flags -mieee" - } - if { [istarget rx-*-*] } { - return "$flags -mnofpu" - } - return $flags -} - -# Add to FLAGS the flags needed to enable functions to bind locally -# when using pic/PIC passes in the testsuite. - -proc add_options_for_bind_pic_locally { flags } { - if {[check_no_compiler_messages using_pic2 assembly { - #if __PIC__ != 2 - #error FOO - #endif - }]} { - return "$flags -fPIE" - } - if {[check_no_compiler_messages using_pic1 assembly { - #if __PIC__ != 1 - #error FOO - #endif - }]} { - return "$flags -fpie" - } - - return $flags -} - -# Add to FLAGS the flags needed to enable 64-bit vectors. - -proc add_options_for_double_vectors { flags } { - if [is-effective-target arm_neon_ok] { - return "$flags -mvectorize-with-neon-double" - } - - return $flags -} - -# Return 1 if the target provides a full C99 runtime. - -proc check_effective_target_c99_runtime { } { - return [check_cached_effective_target c99_runtime { - global srcdir - - set file [open "$srcdir/gcc.dg/builtins-config.h"] - set contents [read $file] - close $file - append contents { - #ifndef HAVE_C99_RUNTIME - #error FOO - #endif - } - check_no_compiler_messages_nocache c99_runtime assembly \ - $contents [add_options_for_c99_runtime ""] - }] -} - -# Return 1 if target wchar_t is at least 4 bytes. - -proc check_effective_target_4byte_wchar_t { } { - return [check_no_compiler_messages 4byte_wchar_t object { - int dummy[sizeof (__WCHAR_TYPE__) >= 4 ? 1 : -1]; - }] -} - -# Return 1 if the target supports automatic stack alignment. - -proc check_effective_target_automatic_stack_alignment { } { - # Ordinarily x86 supports automatic stack alignment ... - if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then { - if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } { - # ... except Win64 SEH doesn't. Succeed for Win32 though. - return [check_effective_target_ilp32]; - } - return 1; - } - return 0; -} - -# Return true if we are compiling for AVX target. - -proc check_avx_available { } { - if { [check_no_compiler_messages avx_available assembly { - #ifndef __AVX__ - #error unsupported - #endif - } ""] } { - return 1; - } - return 0; -} - -# Return true if 32- and 16-bytes vectors are available. - -proc check_effective_target_vect_sizes_32B_16B { } { - return [check_avx_available]; -} - -# Return true if 128-bits vectors are preferred even if 256-bits vectors -# are available. - -proc check_prefer_avx128 { } { - if ![check_avx_available] { - return 0; - } - return [check_no_messages_and_pattern avx_explicit "xmm" assembly { - float a[1024],b[1024],c[1024]; - void foo (void) { int i; for (i = 0; i < 1024; i++) a[i]=b[i]+c[i];} - } "-O2 -ftree-vectorize"] -} - - -# Return 1 if avx512f instructions can be compiled. - -proc check_effective_target_avx512f { } { - return [check_no_compiler_messages avx512f object { - typedef double __m512d __attribute__ ((__vector_size__ (64))); - - __m512d _mm512_add (__m512d a) - { - return __builtin_ia32_addpd512_mask (a, a, a, 1, 4); - } - } "-O2 -mavx512f" ] -} - -# Return 1 if avx instructions can be compiled. - -proc check_effective_target_avx { } { - return [check_no_compiler_messages avx object { - void _mm256_zeroall (void) - { - __builtin_ia32_vzeroall (); - } - } "-O2 -mavx" ] -} - -# Return 1 if avx2 instructions can be compiled. -proc check_effective_target_avx2 { } { - return [check_no_compiler_messages avx2 object { - typedef long long __v4di __attribute__ ((__vector_size__ (32))); - __v4di - mm256_is32_andnotsi256 (__v4di __X, __v4di __Y) - { - return __builtin_ia32_andnotsi256 (__X, __Y); - } - } "-O0 -mavx2" ] -} - -# Return 1 if sse instructions can be compiled. -proc check_effective_target_sse { } { - return [check_no_compiler_messages sse object { - int main () - { - __builtin_ia32_stmxcsr (); - return 0; - } - } "-O2 -msse" ] -} - -# Return 1 if sse2 instructions can be compiled. -proc check_effective_target_sse2 { } { - return [check_no_compiler_messages sse2 object { - typedef long long __m128i __attribute__ ((__vector_size__ (16))); - - __m128i _mm_srli_si128 (__m128i __A, int __N) - { - return (__m128i)__builtin_ia32_psrldqi128 (__A, 8); - } - } "-O2 -msse2" ] -} - -# Return 1 if F16C instructions can be compiled. - -proc check_effective_target_f16c { } { - return [check_no_compiler_messages f16c object { - #include "immintrin.h" - float - foo (unsigned short val) - { - return _cvtsh_ss (val); - } - } "-O2 -mf16c" ] -} - -# Return 1 if C wchar_t type is compatible with char16_t. - -proc check_effective_target_wchar_t_char16_t_compatible { } { - return [check_no_compiler_messages wchar_t_char16_t object { - __WCHAR_TYPE__ wc; - __CHAR16_TYPE__ *p16 = &wc; - char t[(((__CHAR16_TYPE__) -1) < 0 == ((__WCHAR_TYPE__) -1) < 0) ? 1 : -1]; - }] -} - -# Return 1 if C wchar_t type is compatible with char32_t. - -proc check_effective_target_wchar_t_char32_t_compatible { } { - return [check_no_compiler_messages wchar_t_char32_t object { - __WCHAR_TYPE__ wc; - __CHAR32_TYPE__ *p32 = &wc; - char t[(((__CHAR32_TYPE__) -1) < 0 == ((__WCHAR_TYPE__) -1) < 0) ? 1 : -1]; - }] -} - -# Return 1 if pow10 function exists. - -proc check_effective_target_pow10 { } { - return [check_runtime pow10 { - #include - int main () { - double x; - x = pow10 (1); - return 0; - } - } "-lm" ] -} - -# Return 1 if current options generate DFP instructions, 0 otherwise. - -proc check_effective_target_hard_dfp {} { - return [check_no_messages_and_pattern hard_dfp "!adddd3" assembly { - typedef float d64 __attribute__((mode(DD))); - d64 x, y, z; - void foo (void) { z = x + y; } - }] -} - -# Return 1 if string.h and wchar.h headers provide C++ requires overloads -# for strchr etc. functions. - -proc check_effective_target_correct_iso_cpp_string_wchar_protos { } { - return [check_no_compiler_messages correct_iso_cpp_string_wchar_protos assembly { - #include - #include - #if !defined(__cplusplus) \ - || !defined(__CORRECT_ISO_CPP_STRING_H_PROTO) \ - || !defined(__CORRECT_ISO_CPP_WCHAR_H_PROTO) - ISO C++ correct string.h and wchar.h protos not supported. - #else - int i; - #endif - }] -} - -# Return 1 if GNU as is used. - -proc check_effective_target_gas { } { - global use_gas_saved - global tool - - if {![info exists use_gas_saved]} { - # Check if the as used by gcc is GNU as. - set gcc_as [lindex [${tool}_target_compile "-print-prog-name=as" "" "none" ""] 0] - # Provide /dev/null as input, otherwise gas times out reading from - # stdin. - set status [remote_exec host "$gcc_as" "-v /dev/null"] - set as_output [lindex $status 1] - if { [ string first "GNU" $as_output ] >= 0 } { - set use_gas_saved 1 - } else { - set use_gas_saved 0 - } - } - return $use_gas_saved -} - -# Return 1 if GNU ld is used. - -proc check_effective_target_gld { } { - global use_gld_saved - global tool - - if {![info exists use_gld_saved]} { - # Check if the ld used by gcc is GNU ld. - set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=ld" "" "none" ""] 0] - set status [remote_exec host "$gcc_ld" "--version"] - set ld_output [lindex $status 1] - if { [ string first "GNU" $ld_output ] >= 0 } { - set use_gld_saved 1 - } else { - set use_gld_saved 0 - } - } - return $use_gld_saved -} - -# Return 1 if the compiler has been configure with link-time optimization -# (LTO) support. - -proc check_effective_target_lto { } { - global ENABLE_LTO - return [info exists ENABLE_LTO] -} - -# Return 1 if -mx32 -maddress-mode=short can compile, 0 otherwise. - -proc check_effective_target_maybe_x32 { } { - return [check_no_compiler_messages maybe_x32 object { - void foo (void) {} - } "-mx32 -maddress-mode=short"] -} - -# Return 1 if this target supports the -fsplit-stack option, 0 -# otherwise. - -proc check_effective_target_split_stack {} { - return [check_no_compiler_messages split_stack object { - void foo (void) { } - } "-fsplit-stack"] -} - -# Return 1 if this target supports the -masm=intel option, 0 -# otherwise - -proc check_effective_target_masm_intel {} { - return [check_no_compiler_messages masm_intel object { - extern void abort (void); - } "-masm=intel"] -} - -# Return 1 if the language for the compiler under test is C. - -proc check_effective_target_c { } { - global tool - if [string match $tool "gcc"] { - return 1 - } - return 0 -} - -# Return 1 if the language for the compiler under test is C++. - -proc check_effective_target_c++ { } { - global tool - if [string match $tool "g++"] { - return 1 - } - return 0 -} - -# Check whether the current active language standard supports the features -# of C++11/C++1y by checking for the presence of one of the -std -# flags. This assumes that the default for the compiler is C++98, and that -# there will never be multiple -std= arguments on the command line. -proc check_effective_target_c++11_only { } { - if ![check_effective_target_c++] { - return 0 - } - return [check-flags { { } { } { -std=c++0x -std=gnu++0x -std=c++11 -std=gnu++11 } }] -} -proc check_effective_target_c++11 { } { - if [check_effective_target_c++11_only] { - return 1 - } - return [check_effective_target_c++1y] -} -proc check_effective_target_c++11_down { } { - if ![check_effective_target_c++] { - return 0 - } - return ![check_effective_target_c++1y] -} - -proc check_effective_target_c++1y_only { } { - if ![check_effective_target_c++] { - return 0 - } - return [check-flags { { } { } { -std=c++1y -std=gnu++1y -std=c++14 -std=gnu++14 } }] -} -proc check_effective_target_c++1y { } { - return [check_effective_target_c++1y_only] -} - -proc check_effective_target_c++98_only { } { - if ![check_effective_target_c++] { - return 0 - } - return ![check_effective_target_c++11] -} - -# Return 1 if expensive testcases should be run. - -proc check_effective_target_run_expensive_tests { } { - if { [getenv GCC_TEST_RUN_EXPENSIVE] != "" } { - return 1 - } - return 0 -} - -# Returns 1 if "mempcpy" is available on the target system. - -proc check_effective_target_mempcpy {} { - return [check_function_available "mempcpy"] -} - -# Check whether the vectorizer tests are supported by the target and -# append additional target-dependent compile flags to DEFAULT_VECTCFLAGS. -# Set dg-do-what-default to either compile or run, depending on target -# capabilities. Return 1 if vectorizer tests are supported by -# target, 0 otherwise. - -proc check_vect_support_and_set_flags { } { - global DEFAULT_VECTCFLAGS - global dg-do-what-default - - if [istarget powerpc-*paired*] { - lappend DEFAULT_VECTCFLAGS "-mpaired" - if [check_750cl_hw_available] { - set dg-do-what-default run - } else { - set dg-do-what-default compile - } - } elseif [istarget powerpc*-*-*] { - # Skip targets not supporting -maltivec. - if ![is-effective-target powerpc_altivec_ok] { - return 0 - } - - lappend DEFAULT_VECTCFLAGS "-maltivec" - if [check_p8vector_hw_available] { - lappend DEFAULT_VECTCFLAGS "-mpower8-vector" "-mno-allow-movmisalign" - } elseif [check_vsx_hw_available] { - lappend DEFAULT_VECTCFLAGS "-mvsx" "-mno-allow-movmisalign" - } - - if [check_vmx_hw_available] { - set dg-do-what-default run - } else { - if [is-effective-target ilp32] { - # Specify a cpu that supports VMX for compile-only tests. - lappend DEFAULT_VECTCFLAGS "-mcpu=970" - } - set dg-do-what-default compile - } - } elseif { [istarget spu-*-*] } { - set dg-do-what-default run - } elseif { [istarget i?86-*-*] || [istarget x86_64-*-*] } { - lappend DEFAULT_VECTCFLAGS "-msse2" - if { [check_effective_target_sse2_runtime] } { - set dg-do-what-default run - } else { - set dg-do-what-default compile - } - } elseif { [istarget mips*-*-*] - && ([check_effective_target_mpaired_single] - || [check_effective_target_mips_loongson]) - && [check_effective_target_nomips16] } { - if { [check_effective_target_mpaired_single] } { - lappend DEFAULT_VECTCFLAGS "-mpaired-single" - } - set dg-do-what-default run - } elseif [istarget sparc*-*-*] { - lappend DEFAULT_VECTCFLAGS "-mcpu=ultrasparc" "-mvis" - if [check_effective_target_ultrasparc_hw] { - set dg-do-what-default run - } else { - set dg-do-what-default compile - } - } elseif [istarget alpha*-*-*] { - # Alpha's vectorization capabilities are extremely limited. - # It's more effort than its worth disabling all of the tests - # that it cannot pass. But if you actually want to see what - # does work, command out the return. - return 0 - - lappend DEFAULT_VECTCFLAGS "-mmax" - if [check_alpha_max_hw_available] { - set dg-do-what-default run - } else { - set dg-do-what-default compile - } - } elseif [istarget ia64-*-*] { - set dg-do-what-default run - } elseif [is-effective-target arm_neon_ok] { - eval lappend DEFAULT_VECTCFLAGS [add_options_for_arm_neon ""] - # NEON does not support denormals, so is not used for vectorization by - # default to avoid loss of precision. We must pass -ffast-math to test - # vectorization of float operations. - lappend DEFAULT_VECTCFLAGS "-ffast-math" - if [is-effective-target arm_neon_hw] { - set dg-do-what-default run - } else { - set dg-do-what-default compile - } - } elseif [istarget "aarch64*-*-*"] { - set dg-do-what-default run - } else { - return 0 - } - - return 1 -} - -proc check_effective_target_non_strict_align {} { - return [check_no_compiler_messages non_strict_align assembly { - char *y; - typedef char __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) c; - c *z; - void foo(void) { z = (c *) y; } - } "-Wcast-align"] -} - -# Return 1 if the target has . - -proc check_effective_target_ucontext_h { } { - return [check_no_compiler_messages ucontext_h assembly { - #include - }] -} - -proc check_effective_target_aarch64_tiny { } { - if { [istarget aarch64*-*-*] } { - return [check_no_compiler_messages aarch64_tiny object { - #ifdef __AARCH64_CMODEL_TINY__ - int dummy; - #else - #error target not AArch64 tiny code model - #endif - }] - } else { - return 0 - } -} - -proc check_effective_target_aarch64_small { } { - if { [istarget aarch64*-*-*] } { - return [check_no_compiler_messages aarch64_small object { - #ifdef __AARCH64_CMODEL_SMALL__ - int dummy; - #else - #error target not AArch64 small code model - #endif - }] - } else { - return 0 - } -} - -proc check_effective_target_aarch64_large { } { - if { [istarget aarch64*-*-*] } { - return [check_no_compiler_messages aarch64_large object { - #ifdef __AARCH64_CMODEL_LARGE__ - int dummy; - #else - #error target not AArch64 large code model - #endif - }] - } else { - return 0 - } -} - -# Return 1 if is available with all the standard IEEE -# exceptions and floating-point exceptions are raised by arithmetic -# operations. (If the target requires special options for "inexact" -# exceptions, those need to be specified in the testcases.) - -proc check_effective_target_fenv_exceptions {} { - return [check_runtime fenv_exceptions { - #include - #include - #ifndef FE_DIVBYZERO - # error Missing FE_DIVBYZERO - #endif - #ifndef FE_INEXACT - # error Missing FE_INEXACT - #endif - #ifndef FE_INVALID - # error Missing FE_INVALID - #endif - #ifndef FE_OVERFLOW - # error Missing FE_OVERFLOW - #endif - #ifndef FE_UNDERFLOW - # error Missing FE_UNDERFLOW - #endif - volatile float a = 0.0f, r; - int - main (void) - { - r = a / a; - if (fetestexcept (FE_INVALID)) - exit (0); - else - abort (); - } - } "-std=gnu99"] -} - -# Return 1 if LOGICAL_OP_NON_SHORT_CIRCUIT is set to 0 for the current target. - -proc check_effective_target_logical_op_short_circuit {} { - if { [istarget mips*-*-*] - || [istarget arc*-*-*] - || [istarget avr*-*-*] - || [istarget crisv32-*-*] || [istarget cris-*-*] - || [istarget s390*-*-*] - || [check_effective_target_arm_cortex_m] } { - return 1 - } - return 0 -} - -# Record that dg-final test TEST requires convential compilation. - -proc force_conventional_output_for { test } { - if { [info proc $test] == "" } { - perror "$test does not exist" - exit 1 - } - proc ${test}_required_options {} { - global gcc_force_conventional_output - return $gcc_force_conventional_output - } -} - diff --git a/gcc-4.9/gcc/testsuite/lib/ubsan-dg.exp b/gcc-4.9/gcc/testsuite/lib/ubsan-dg.exp index fecce7bf0..a8eb4f7aa 100644 --- a/gcc-4.9/gcc/testsuite/lib/ubsan-dg.exp +++ b/gcc-4.9/gcc/testsuite/lib/ubsan-dg.exp @@ -75,12 +75,12 @@ proc ubsan_init { args } { set ubsan_saved_TEST_ALWAYS_FLAGS $TEST_ALWAYS_FLAGS } if [info exists ALWAYS_CXXFLAGS] { - set ALWAYS_CXXFLAGS [concat "{ldflags=$link_flags}" $ALWAYS_CXXFLAGS] + set ALWAYS_CXXFLAGS [concat "{ldflags=$link_flags -static-libubsan}" $ALWAYS_CXXFLAGS] } else { if [info exists TEST_ALWAYS_FLAGS] { - set TEST_ALWAYS_FLAGS "$link_flags $TEST_ALWAYS_FLAGS" + set TEST_ALWAYS_FLAGS "$link_flags -static-libubsan $TEST_ALWAYS_FLAGS" } else { - set TEST_ALWAYS_FLAGS "$link_flags" + set TEST_ALWAYS_FLAGS "$link_flags -static-libubsan" } } if { $link_flags != "" } { -- cgit v1.2.3