aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-11-17Make ltrans type canonicals compatible with WPA onesJan Hubicka4-5/+10
This patch fixes profiledbootstrap failure with LTO enabled. Not refining alias sets from WPA to ltrans time is a good invariant to maintain and the canonical type hash behaves this way. However I broke this with the ODR logic. Normally we define canonical types for C++ ODR types according to their type names. However to make ODR types compatible with C types we check if structurally equivalent C type exists and if so, we ignore ODR names giving up on the precision. This however is not stable between WPA and ltrans since at ltrans the type merging does not see as many types as WPA does. To make this consistent the patch makes WPA ODR_TYPE_P == 0 for ODR types that conflicted with non-ODR type. I had to drop one sanity check in ipa-utils.h (that I think is not very important - I added it while introducing CXX_ODR_P machinery) and also it now may happen that we query odr_based_tbaa_p before registering first ODR type so we do not want to ICE here. ODR type registration happens early to produce ODR violation warings. Those are not done at ltrans, so dropping the registration is safe. The type will still be added while computing the type inheritance graph if needed for devirtualization (and late devirtualization is not very useful anyway since it won't enable inlining). gcc/ChangeLog: PR bootstrap/97857 * ipa-devirt.c (odr_based_tbaa_p): Do not ICE when odr_hash is not initialized * ipa-utils.h (type_with_linkage_p): Do not sanity check CXX_ODR_P. * tree-streamer-out.c (pack_ts_type_common_value_fields): Set CXX_ODR_P according to the canonical type. gcc/lto/ChangeLog: PR bootstrap/97857 * lto-common.c (gimple_register_canonical_type_1): Only register types with TYPE_CXX_ODR_P flag; sanity check that no conflict happens at ltrans time.
2020-11-17langhooks: preprocessor hooks for c++ modulesNathan Sidwell5-13/+94
This is a slightly modified version of 01-langhooks.def. I realized I didn't need the deferred macro langhook -- that can be directly installed into the preprocessor callbacks via preprocess_options lang hook. gcc/ * langhooks-def.h (LANG_HOOKS_PREPROCESS_MAIN_FILE) (LANG_HOOKS_PREPROCESS_OPTIONS, LANG_HOOKS_PREPROCESS_UNDEF) (LANG_HOOKS_PREPROCESS_TOKEN): New. (LANG_HOOKS_INITIALIZER): Add them. * langhooks.h (struct lang_hooks): Add preprocess_main_file, preprocess_options, preprocess_undef, preprocess_token hooks. Add enum PT_flags. gcc/c-family/ * c-lex.c: #include "langhooks.h". (cb_undef): Maybe call preprocess_undef lang hook. * c-opts.c (c_common_post_options): Maybe call preprocess_options lang hook. (push_command_line_include): Maybe call preprocess_main_file lang hook. (cb_file_change): Likewise. * c-ppoutput.c: #include "langhooks.h. (scan_translation_unit): Maybe call preprocess_token lang hook. (class do_streamer): New, derive from token_streamer. (directives_only_cb): Data pointer is do_streamer, call preprocess_token lang hook. (scan_translation_unit_directives_only): Use do_streamer. (print_line_1): Move src_line recording to after string output. (cb_undef): Maybe call preprocess_undef lang hook.
2020-11-17c-family: token streamerNathan Sidwell1-107/+5
This is broken out of modules patch 01-langhooks.diff, I realized that this part is independent, and removes some duplicated code -- migrated to the token_streamer class. gcc/c-family/ * c-ppoutput.c (scan_translation_unit): Use token_streamer, remove code duplicating that functionality.
2020-11-17x86: Add a testcase for PR target/31799H.J. Lu1-0/+12
Add a testcase for PR target/31799 which was fixed by commit 4f0473fe89e68bf7c09542ee5c3684da25a5b435 Author: Uros Bizjak <ubizjak@gmail.com> Date: Fri May 12 21:04:05 2017 +0200 compare-elim.c (try_eliminate_compare): Canonicalize operation with embedded compare to [(set (reg:CCM) (compare:CCM... * compare-elim.c (try_eliminate_compare): Canonicalize operation with embedded compare to [(set (reg:CCM) (compare:CCM (operation) (immediate))) (set (reg) (operation)]. * config/i386/i386.c (TARGET_FLAGS_REGNUM): New define. in GCC 8. PR target/31799 * gcc.target/i386/pr31799.c: New test.
2020-11-17aarch64: Remove XFAILs for two SVE testsRichard Sandiford2-5/+2
These tests started passing a while ago, so remove the XFAILs. gcc/testsuite/ * gcc.target/aarch64/sve/cond_cnot_1.c: Remove XFAIL. * gcc.target/aarch64/sve/cond_unary_1.c: Likewise.
2020-11-17PR97693: Specify required vectype in vectorizable_callRichard Sandiford2-1/+17
The vectorizable_call part of r11-1143 dropped the required vectype when moving from vect_get_vec_def_for_operand to vect_get_vec_defs_for_operand. This caused an ICE on the testcase for SVE, because we ended up with a non-predicate value being passed to a predicate input. AFAICT this was the only instance of that happening. The types seemed to get carried forward for all the other converted calls. gcc/ PR tree-optimization/97693 * tree-vect-stmts.c (vectorizable_call): Pass the required vectype to vect_get_vec_defs_for_operand. gcc/testsuite/ PR tree-optimization/97693 * gcc.dg/vect/pr97693.c: New test.
2020-11-17testsuite: Add a vect_load_lanes guardRichard Sandiford1-1/+1
We still fall back to load/store-lanes for slp-46.c, if the target supports it. gcc/testsuite/ * gcc.dg/vect/slp-46.c: XFAIL test for SLP on vect_load_lanes targets.
2020-11-17testsuite: Add a vect_element_align_preferred guardRichard Sandiford1-1/+1
We don't try to increase the alignment of decls if vect_element_align_preferred. gcc/testsuite/ * gcc.dg/vect/aligned-section-anchors-nest-1.c: XFAIL alignment test if vect_element_align_preferred.
2020-11-17testsuite: Adjust vect/bb-slp-subgroups-3.c for VL vectorsRichard Sandiford1-1/+4
Because we disable the cost model, targets with variable-length vectors can end up vectorising the store to a[0..7] on its own. With the cost model we do something sensible. gcc/testsuite/ * gcc.dg/vect/bb-slp-subgroups-3.c: XFAIL for variable-length vectors.
2020-11-17testsuite: Adjust vect/pr65947-8.c for SVERichard Sandiford1-3/+3
We can vectorise vect/pr65947-8.c for SVE, as we can for GCN. gcc/testsuite/ * gcc.dg/vect/pr65947-8.c: Expect the loop to be vectorized for SVE.
2020-11-17testsuite: XFAIL SLP induction tests for VL vectorsRichard Sandiford6-6/+12
We don't yet support SLP inductions for variable-length vectors, so this patch XFAILs some associated tests. (Inductions aren't inherently difficult to support. It just hasn't been done yet.) gcc/testsuite/ * gcc.dg/vect/pr97678.c: XFAIL test for SLP vectorization for variable-length vectors. * gcc.dg/vect/pr97835.c: Likewise. * gcc.dg/vect/slp-49.c: Likewise. * gcc.dg/vect/vect-outer-slp-1.c: Likewise. * gcc.dg/vect/vect-outer-slp-2.c: Likewise. * gcc.dg/vect/vect-outer-slp-3.c: Likewise.
2020-11-17testsuite: XFAIL some SLP reduction tests for VLA SVERichard Sandiford2-4/+8
For variable-length SVE, we can only use SLP for N scalars of type T if the number of Ts in a vector is a multiple of N. For ints this means that N must be 4 or 2, so this patch XFAILs two tests for N==8. The exact limit seems inherently target-specific -- variable-length vectors with a 256-bit granule would work fine -- so I used aarch64_sve selectors on the XFAILs. gcc/testsuite/ * gcc.dg/vect/slp-reduc-4.c: XFAIL test for SLP vectorization for variable-length SVE. * gcc.dg/vect/slp-reduc-7.c: Likewise.
2020-11-17testsuite: Remove XFAIL for variable-length vectorsRichard Sandiford1-1/+1
The XFAIL for variable-length vectors is no longer needed since we can't build the required constant vector and so fall back to fixed-length alternatives. gcc/testsuite/ * gcc.dg/vect/bb-slp-43.c: Remove XFAIL for vect_variable_length.
2020-11-17testsuite: Extend vector() regexpRichard Sandiford1-1/+1
For variable-length vectors, the N inside “vector(N) T” can contain the characters ‘[’, ‘]’ and ‘,’. gcc/testsuite/ * gcc.dg/vect/pr91750.c: Allow "[]," inside a vector(...) lane count.
2020-11-17gcc: Add `ll` and `L` length modifiers for `ms_printf`Liu Hao2-26/+49
Previous code abused `FMT_LEN_L` for the `I` modifier. As `L` is a valid modifier for `f`, `e`, `g`, etc. and `I` has the same semantics as the C99 `z` modifier, `FMT_LEN_z` is now used instead. First, in the Microsoft ABI, type `long double` has the same layout as type `double`, so `%Lg` behaves identically to `%g`. Users should pass in `double`s instead of `long double`s, as GCC uses the 10-byte format. Second, with a CRT that is recent enough (MSVCRT since Vista, MSVCR80, UCRT, or mingw-w64 8.0), `printf`-family functions can handle the `ll` length modifier correctly. This ability is assumed to be available universally. A lot of libraries (such as libgomp) that use the `format(printf, ...)` attribute used to suffer from warnings about unknown format specifiers. Reference: https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/tcxf1dw6(v=vs.90) Reference: https://docs.microsoft.com/en-us/cpp/porting/visual-cpp-what-s-new-2003-through-2015#new-crt-features Signed-off-by: Liu Hao <lh_mouse@126.com> gcc/ChangeLog: * config/i386/msformat-c.c: Add more length modifiers. gcc/testsuite/ChangeLog: * gcc.dg/format/ms_c99-printf-3.c: Update tests.
2020-11-17MingW: Don't add suffix for nul deviceTamar Christina1-2/+2
This patch fixes an issue where on systems that are HAVE_TARGET_EXECUTABLE_SUFFIX the driver calls convert_filename in order to add the suffix to the filename. However while it excludes `-` it doesn't exclude the null device. This patches changes the check to exclude anything that is not a file by calling not_actual_file_p instead. This also fixes a bug in not_actual_file_p which was accidentally testing a the global variable output_file instead of the supplied argument. This hasn't been an issue so far because because not_actual_file_p was only used on output_file till now. This fixes the adding of an extension to the nul device which is against the recommendations on msdn[0] and makes it harder for the next tool in line to detect it. Bootstrapped Regtested on x86_64-w64-mingw32 and no issues. Did do a bootstrap on x86_64-pc-linux-gnu but no regtest as it's not a HAVE_TARGET_EXECUTABLE_SUFFIX system. [0] https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file gcc/ChangeLog: PR driver/97574 * gcc.c (convert_filename): Don't add suffix to things that are not files. (not_actual_file_p): Use supplied argument.
2020-11-17c: Reject _Atomic type * as last argument to __builtin_*_overflow [PR90628]Jakub Jelinek2-2/+52
During the __builtin_clear_padding implementation, I've noticed we don't diagnose _Atomic whatever * as last argument to __builtin_*_overflow. As the storing by that builtin isn't atomic in any way, I think we should reject it. 2020-11-17 Jakub Jelinek <jakub@redhat.com> PR c/90628 * c-common.c (check_builtin_function_arguments) <case BUILT_IN_ADD_OVERFLOW>: Diagnose when last argument is pointer to _Atomic. For the TYPE_READONLY case, adjust message to be usable for more builtins and argument positions. * gcc.dg/builtin-arith-overflow-4.c: New test.
2020-11-17guality: Workaround for guality/pr59776.c testcaseJakub Jelinek1-1/+1
The test has been added 3 years before noipa attribute has been introduced, but already at that point I wanted to avoid IPA opts getting into way, most of the foo function is optimized away and the debug info just points to the caller\s var. With the recent modref/aliasing changes the caller's store to the variable whose address it is passing to the function is optimized away too. I think we should just use noipa to avoid this, though perhaps longer term we should think about some debug info improvements how to deal with that. The caller had before dse1: # DEBUG BEGIN_STMT x.f = 5.0e+0; x.g = 6.0e+0; # DEBUG BEGIN_STMT foo (&x); # DEBUG BEGIN_STMT x ={v} {CLOBBER}; and the x.f and x.g stores are optimized away. If we had a way to pretend the memory contains those values anyway... Tested on x86_64-linux, fixes the guality regressions +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O1 -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fno-use-linker-plugin -flto-partition=none -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -O3 -g -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:17 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.f == 5.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:20 s1.g == 6.0 +FAIL: gcc.dg/guality/pr59776.c -Os -DPREVENT_OPTIMIZATION line pr59776.c:20 s2.f == 5.0 introduced in the last 2 days. 2020-11-17 Jakub Jelinek <jakub@redhat.com> * gcc.dg/guality/pr59776.c (foo): Use noipa attribute instead of noinline, noclone.
2020-11-17Relocatable read-only section support for absolute jump tableHaochen Gui8-38/+92
This patch puts absolute jump tables into a relocatable read-only section if they are on ELF target and relocation is supported. gcc/ChangeLog: * final.c (final_scan_insn_1): Set jump table relocatable as the second argument of targetm.asm_out.function_rodata_section. * output.h (default_function_rodata_section, default_no_function_rodata_section): Add the second argument to the declarations. * target.def (function_rodata_section): Change the doc and add the second argument. * doc/tm.texi: Regenerate. * varasm.c (jumptable_relocatable): Implement. (default_function_rodata_section): Add the second argument and the support for relocatable read only sections. (default_no_function_rodata_section): Add the second argument. (function_mergeable_rodata_prefix): Set the second argument to false. * config/mips/mips.c (mips_function_rodata_section): Add the second arugment and set it to false. * config/s390/s390.c (targetm.asm_out.function_rodata_section): Set the second argument to false. * config/s390/s390.md: Likewise.
2020-11-17Support variable index vec_set.liuhongt10-3/+379
gcc/ChangeLog: PR target/97194 * config/i386/i386-expand.c (ix86_expand_vector_set_var): New function. * config/i386/i386-protos.h (ix86_expand_vector_set_var): New Decl. * config/i386/predicates.md (vec_setm_operand): New predicate, true for const_int_operand or register_operand under TARGET_AVX2. * config/i386/sse.md (vec_set<mode>): Support both constant and variable index vec_set. gcc/testsuite/ChangeLog: * gcc.target/i386/avx2-vec-set-1.c: New test. * gcc.target/i386/avx2-vec-set-2.c: New test. * gcc.target/i386/avx512bw-vec-set-1.c: New test. * gcc.target/i386/avx512bw-vec-set-2.c: New test. * gcc.target/i386/avx512f-vec-set-2.c: New test. * gcc.target/i386/avx512vl-vec-set-2.c: New test.
2020-11-16PR middle-end/97840 - Bogus -Wmaybe-uninitialized passing an empty object to ↵Martin Sebor3-9/+7
a function gcc/ChangeLog: * tree-ssa-uninit.c (maybe_warn_operand): Call is_empty_type. * tree.c (default_is_empty_type): Rename... (is_empty_type): ...to this. * tree.h (is_empty_type): Declare.
2020-11-16PR middle-end/95673 - missing -Wstring-compare for an impossible strncmp testMartin Sebor2-17/+142
gcc/ChangeLog: PR middle-end/95673 * tree-ssa-strlen.c (used_only_for_zero_equality): Rename... (use_in_zero_equality): ...to this. Add a default argument. (handle_builtin_memcmp): Adjust to the name change above. (handle_builtin_string_cmp): Same. (maybe_warn_pointless_strcmp): Same. Pass in an explicit argument. gcc/testsuite/ChangeLog: PR middle-end/95673 * gcc.dg/Wstring-compare-3.c: New test.
2020-11-17float.h: C2x decimal signaling NaN macrosJoseph Myers4-0/+110
C2x adds macros for decimal floating-point signaling NaNs to <float.h>. Add these macros to GCC's <float.h> implementation. Note that the current C2x draft has these under incorrect names D32_SNAN, D64_SNAN, D128_SNAN. The intent was to change the naming convention to be consistent with other <float.h> macros when they were moved to <float.h>, so DEC32_SNAN, DEC64_SNAN, DEC128_NAN, which this patch uses (as does the current draft integration of TS 18661-3 as an Annex to C2x, for its _Decimal* and _Decimal*x types). Bootstrapped with no regressions for x86_64-pc-linux-gnu. gcc/ 2020-11-17 Joseph Myers <joseph@codesourcery.com> * ginclude/float.h (DEC32_SNAN, DEC64_SNAN, DEC128_SNAN): New C2x macros. gcc/testsuite/ 2020-11-17 Joseph Myers <joseph@codesourcery.com> * gcc.dg/dfp/c2x-float-dfp-7.c, gcc.dg/dfp/c2x-float-dfp-8.c: New tests. * gcc.dg/c2x-float-no-dfp-3.c: Also check that DEC32_SNAN, DEC64_SNAN and DEC128_SNAN are not defined.
2020-11-17float.h: C2x NaN and Inf macrosJoseph Myers27-0/+585
C2x adds macros for NaNs and infinities to <float.h>, some of them previously in <math.h> (and some still in <math.h> as well in C2x as an obsolescent feature). Add these macros to GCC's <float.h> implementation. This omits the macros for DFP signaling NaNs, leaving those to be added in a separate patch. However, it includes the _FloatN / _FloatNx macros (conditional on __STDC_WANT_IEC_60559_TYPES_EXT__) in the current draft version of the integration of TS 18661-3 into C2x as an Annex. As GCC allows duplicate macro definitions with different expansions in system headers, it should be OK if <math.h> defines INFINITY or NAN with a slightly different expansion (e.g. different choice of whether there is whitespace between tokens); tests are added including <float.h> and <math.h> in either order. Because <float.h> uses #undef on all macros before defining them, even with -Wsystem-headers there could only ever be issues when <math.h> is included after <float.h>. Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc/ 2020-11-17 Joseph Myers <joseph@codesourcery.com> * ginclude/float.h (INFINITY, NAN, FLT_SNAN, DBL_SNAN, LDBL_SNAN) (FLT16_SNAN, FLT32_SNAN, FLT64_SNAN, FLT128_SNAN, FLT32X_SNAN) (FLT64X_SNAN, FLT128X_SNAN, DEC_INFINITY, DEC_NAN): New C2x macros. * doc/sourcebuild.texi (Effective-Target Keywords): Document inff. gcc/testsuite/ 2020-11-17 Joseph Myers <joseph@codesourcery.com> * lib/target-supports.exp (check_effective_target_inff): New. * gcc.dg/c11-float-4.c, gcc.dg/c11-float-5.c, gcc.dg/c11-float-dfp-2.c, gcc.dg/c2x-float-2.c, gcc.dg/c2x-float-3.c, gcc.dg/c2x-float-4.c, gcc.dg/c2x-float-5.c, gcc.dg/c2x-float-6.c, gcc.dg/c2x-float-7.c, gcc.dg/c2x-float-8.c, gcc.dg/c2x-float-9.c, gcc.dg/c2x-float-no-dfp-3.c, gcc.dg/c2x-float-no-dfp-4.c, gcc.dg/dfp/c2x-float-dfp-4.c, gcc.dg/dfp/c2x-float-dfp-5.c, gcc.dg/dfp/c2x-float-dfp-6.c, gcc.dg/torture/float128-nan-floath.c, gcc.dg/torture/float128x-nan-floath.c, gcc.dg/torture/float16-nan-floath.c, gcc.dg/torture/float32-nan-floath.c, gcc.dg/torture/float32x-nan-floath.c, gcc.dg/torture/float64-nan-floath.c, gcc.dg/torture/float64x-nan-floath.c, gcc.dg/torture/floatn-nan-floath.h: New tests.
2020-11-17Daily bump.GCC Administrator9-1/+271
2020-11-16Update documentation for spec filesArmin Brauns via Gcc-patches2-10/+111
gcc * gcc.c: Document %T spec file directive. * doc/invoke.texi: Remove %p, %P spec file directives. Add %M, %R, %V, %nSTR, %>S, %<S*, %{%:function(args):X}, %@{...} spec file directives add sanitize, version-compare, include, gt and debug-level-gt spec functions.
2020-11-17[RS6000] Use LIB2_SIDITI_CONV_FUNCS in place of ppc64-fp.cAlan Modra2-239/+1
This patch retires ppc64-fp.c in favour of using "LIB2_SIDITI_CONV_FUNCS = yes", which is a lot better solution than having a copy of selected libgcc2.c functions. * config/rs6000/t-ppc64-fp (LIB2ADD): Delete. (LIB2_SIDITI_CONV_FUNCS): Define. * config/rs6000/ppc64-fp.c: Delete file.
2020-11-16Improve code generation for x86_64 [PR 92180]Roger Sayle5-5/+48
This patch catches a missed optimization opportunity where GCC currently generates worse code than LLVM. The issue, as nicely analyzed in bugzilla, boils down to the following three insns in combine: (insn 6 5 7 2 (parallel [ (set (reg:DI 85) (ashift:DI (reg:DI 85) (const_int 32 [0x20]))) (clobber (reg:CC 17 flags)) ]) "pr92180.c":4:10 564 {*ashldi3_1} (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))) (insn 7 6 14 2 (parallel [ (set (reg:DI 84) (ior:DI (reg:DI 84) (reg:DI 85))) (clobber (reg:CC 17 flags)) ]) "pr92180.c":4:10 454 {*iordi_1} (expr_list:REG_DEAD (reg:DI 85) (expr_list:REG_UNUSED (reg:CC 17 flags) (nil)))) (insn 14 7 15 2 (set (reg/i:SI 0 ax) (subreg:SI (reg:DI 84) 0)) "pr92180.c":5:1 67 {*movsi_internal} (expr_list:REG_DEAD (reg:DI 84) (nil))) Normally, combine/simplify-rtx would notice that insns 6 and 7 (which update highpart bits) are unnecessary as the final insn 14 only requires to lowpart bits. The complication is that insn 14 sets a hard register in targetm.class_likely_spilled_p which prevents combine from performing its simplifications, and removing the redundant instructions. At first glance a fix would appear to require changes to combine, potentially affecting code generation on all small register class targets... An alternate (and I think clever) solution is to spot that this problematic situation can be avoided by the backend. At RTL expansion time, the middle-end has a clear separation between pseudos and hard registers, so the RTL initially contains: (insn 9 8 10 2 (set (reg:SI 86) (subreg:SI (reg:DI 82 [ _1 ]) 0)) "pr92180.c":6:10 -1 (nil)) (insn 10 9 14 2 (set (reg:SI 83 [ <retval> ]) (reg:SI 86)) "pr92180.c":6:10 -1 (nil)) (insn 14 10 15 2 (set (reg/i:SI 0 ax) (reg:SI 83 [ <retval> ])) "pr92180.c":7:1 -1 (nil)) which can be optimized without problems by combine; it is only the intervening passes (initially fwprop1) that propagate computations into sets of hard registers, and disable those opportunities. The solution proposed here is to have the x86 backend/recog prevent early RTL passes composing instructions (that set likely_spilled hard registers) that they (combine) can't simplify, until after reload. We allow sets from pseudo registers, immediate constants and memory accesses, but anything more complicated is performed via a temporary pseudo. Not only does this simplify things for the register allocator, but any remaining register-to-register moves are easily cleaned up by the late optimization passes after reload, such as peephole2 and cprop_hardreg. This patch has been tested on x86_64-pc-linux-gnu with a "make bootstrap" and a "make -k check" with no new failures. Ok for mainline? gcc PR rtl-optimization/92180 * config/i386/i386.c (ix86_hardreg_mov_ok): New function to determine whether (set DST SRC) should be allowed at this point. * config/i386/i386-protos.h (ix86_hardreg_mov_ok): Prototype here. * config/i386/i386-expand.c (ix86_expand_move): Check whether this is a complex set of a likely spilled hard register, and if so place the value in a pseudo, and load the hard reg from it. * config/i386/i386.md (*movdi_internal, *movsi_internal) (*movhi_internal, *movqi_internal): Make these instructions conditional on ix86_hardreg_mov_ok. (*lea<mode>): Make this define_insn_and_split conditional on ix86_hardreg_mov_ok. gcc/testsuite PR rtl-optimization/92180 * gcc.target/i386/pr92180.c: New test.
2020-11-16C-family : Fix a C++ ODR violation [PR97854].Iain Sandoe1-4/+1
The changes in r11-4799 introduced a dummy enum rid type with a different initial member name to the actual version (an ODR violation). Fixed by including the header declaring the actual type. gcc/c-family/ChangeLog: PR objc/97854 * stub-objc.c: Include c-common.h to declare enum rid.
2020-11-16PR fortran/48958 - Add runtime diagnostics for SIZE intrinsic functionHarald Anlauf2-0/+54
Add code for runtime checking of status of ALLOCATABLE and POINTER arguments to the SIZE intrinsic when -fcheck=pointer is specified. gcc/fortran/ChangeLog: * trans-intrinsic.c (gfc_conv_intrinsic_size): Generate runtime checking code for status of argument. gcc/testsuite/ChangeLog: * gfortran.dg/pr48958.f90: New test.
2020-11-16param: Add missing dot for param description.Martin Liska1-1/+1
gcc/ChangeLog: * params.opt: Add missing dot.
2020-11-16mklog: support unidiff 0.5.4Martin Liska1-5/+4
contrib/ChangeLog: * mklog.py: Do not call read on an input stream. Fix some flake8 issues.
2020-11-16IPA tracking of EAF flags in ipa-modref.Jan Hubicka4-198/+1092
this patch implements the IPA propagation part of EAF flags handling in ipa-modref. It extends the local analysis to collect lattice consisting of flags and escape points. SSA name escapes if it is passed directly or indirectly to a function call. If useful flags are found for parameter its escape list is stored into escape summaries. This time each call site is annotated with info on which function parameters escape to what argument of function call. At IPA time we then perform iterative dataflow and produce final flags. ipa-modref is still cheaper than pure-const when running on cc1plus (about 2-3% that is what accounts every non-trivial passs) and the dataflow converges in 1 or 2 iterations. Local analysis does some work to avoid streaming escape points when they are not useful to determine final flags (that is, local escape analysis determined good enough flags). For cc1plus there are 225k calls with useful escape summary. * ipa-modref.c (escape_point): New type. (modref_lattice): New type. (escape_entry): New type. (escape_summary): New type. (escape_summaries_t): New type. (escape_summaries): New static variable. (eaf_flags_useful_p): New function. (modref_summary::useful_p): Add new check_flags attribute; check eaf_flags for usefulness. (modref_summary_lto): Add arg_flags. (modref_summary_lto::useful_p): Add new check_flags attribute; check eaf_flags for usefulness. (dump_modref_edge_summaries): New function. (remove_modref_edge_summaries): New function. (ignore_retval_p): New predicate. (ignore_stores_p): Also ignore for const. (remove_summary): Call remove_modref_edge_summaries. (modref_lattice::init): New member function. (modref_lattice::release): New member unction. (modref_lattice::dump): New member function. (modref_lattice::add_escape_point): New member function. (modref_lattice::merge): Two new member functions. (modref_lattice::merge_deref): New member functions. (modref_lattice::merge_direct_load): New member function. (modref_lattice::merge_direct_store): New member function. (call_lhs_flags): Rename to ... (merge_call_lhs_flags): ... this one; reimplement using modreflattice. (analyze_ssa_name_flags): Replace KNOWN_FLAGS param by LATTICE; add IPA parametr; use modref_lattice. (analyze_parms): New parameter IPA and SUMMARY_LTO; update for modref_lattice; initialize escape_summary. (analyze_function): Allocate escape_summaries; update uses of useful_p. (modref_write_escape_summary): New function. (modref_read_escape_summary): New function. (modref_write): Write escape summary. (read_section): Read escape summary. (modref_read): Initialie escape_summaries. (remap_arg_flags): New function. (update_signature): Use it. (escape_map): New structure. (update_escape_summary_1, update_escape_summary): New functions. (ipa_merge_modref_summary_after_inlining): Merge escape summaries. (propagate_unknown_call): Do not remove useless summaries. (remove_useless_summaries): Remove them here. (modref_propagate_in_scc): Update; do not dump scc. (modref_propagate_dump_scc): New function. (modref_merge_call_site_flags): New function. (modref_propagate_flags_in_scc): New function. (pass_ipa_modref::execute): Use modref_propagate_flags_in_scc and modref_propagate_dump_scc; delete escape_summaries. (ipa_modref_c_finalize): Remove escape_summaries. * ipa-modref.h (modref_summary): Update prototype of useful_p. * params.opt (param=modref-max-escape-points): New param. * doc/invoke.texi (modref-max-escape-points): Document.
2020-11-16Disable some bogus -Wmaybe-uninitialized warningsJan Hubicka3-4/+48
gcc/ChangeLog: PR middle-end/97840 * ipa-modref.c (analyze_ssa_name_flags): Skip clobbers if inlining is done. * tree-ssa-uninit.c (maybe_warn_pass_by_reference): Make stmt gcall; skip const calls and unused arguments. (warn_uninitialized_vars): Update prototype. gcc/testsuite/ChangeLog: * g++.dg/warn/uninit-1.C: New test.
2020-11-16Delay SLP instance loads gatheringRichard Biener3-8/+22
This delays filling SLP_INSTANCE_LOADS. 2020-11-16 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vect_gather_slp_loads): Declare. * tree-vect-loop.c (vect_analyze_loop_2): Call vect_gather_slp_loads. * tree-vect-slp.c (vect_build_slp_instance): Do not gather SLP loads here. (vect_gather_slp_loads): Remove wrapper, new function. (vect_slp_analyze_bb_1): Call it.
2020-11-16further optimize non-store-motion LIMRichard Biener1-8/+16
This removes useless work from LIM when store-motion is disabled. 2020-11-16 Richard Biener <rguenther@suse.de> * tree-ssa-loop-im.c (analyze_memory_references): Add store_motion parameter and elide unnecessary work. (tree_ssa_lim_initialize): Likewise. (loop_invariant_motion_in_fun): Pass down store_motion.
2020-11-16IBM Z: Do not run long double tests on old machinesIlya Leoshkevich26-25/+60
gcc/testsuite/ChangeLog: 2020-11-12 Ilya Leoshkevich <iii@linux.ibm.com> * gcc.target/s390/s390.exp (check_effective_target_s390_z14_hw): New predicate. * gcc.target/s390/vector/long-double-caller-abi-run.c: Use the new predicate. * gcc.target/s390/vector/long-double-copysign.c: Likewise. * gcc.target/s390/vector/long-double-from-double.c: Likewise. * gcc.target/s390/vector/long-double-from-float.c: Likewise. * gcc.target/s390/vector/long-double-from-i16.c: Likewise. * gcc.target/s390/vector/long-double-from-i32.c: Likewise. * gcc.target/s390/vector/long-double-from-i64.c: Likewise. * gcc.target/s390/vector/long-double-from-i8.c: Likewise. * gcc.target/s390/vector/long-double-from-u16.c: Likewise. * gcc.target/s390/vector/long-double-from-u32.c: Likewise. * gcc.target/s390/vector/long-double-from-u64.c: Likewise. * gcc.target/s390/vector/long-double-from-u8.c: Likewise. * gcc.target/s390/vector/long-double-to-double.c: Likewise. * gcc.target/s390/vector/long-double-to-float.c: Likewise. * gcc.target/s390/vector/long-double-to-i16.c: Likewise. * gcc.target/s390/vector/long-double-to-i32.c: Likewise. * gcc.target/s390/vector/long-double-to-i64.c: Likewise. * gcc.target/s390/vector/long-double-to-i8.c: Likewise. * gcc.target/s390/vector/long-double-to-u16.c: Likewise. * gcc.target/s390/vector/long-double-to-u32.c: Likewise. * gcc.target/s390/vector/long-double-to-u64.c: Likewise. * gcc.target/s390/vector/long-double-to-u8.c: Likewise. * gcc.target/s390/vector/long-double-wfaxb.c: Likewise. * gcc.target/s390/vector/long-double-wfdxb.c: Likewise. * gcc.target/s390/vector/long-double-wfsxb-1.c: Likewise.
2020-11-16modref: add missing Param Optimization keywordsMartin Liska1-5/+5
Fixes: FAIL: compiler driver --help=common option(s): "^ +-.*[^:.]$" absent from output: " --param=modref-max-depth= Maximum depth of DFS walk used by modref escape analysis" gcc/ChangeLog: * params.opt: All modref parameters miss Optimization and Param keyword as seen in testsuite failure.
2020-11-16Fix -param=modref-max-depth in params.optJan Hubicka1-1/+1
* params.opt (-param=modref-max-depth=): Add missing full stop.
2020-11-16pointer-compare-1.c: Add __attribute__((used))H.J. Lu1-3/+4
c-c++-common/asan/pointer-compare-1.c assumes the certain order for variable placement. Add __attribute__((used)) to avoid variable placement changes due to SHF_GNU_RETAIN. PR testsuite/97803 * c-c++-common/asan/pointer-compare-1.c (global1): Add __attribute__((used)) (global2): Likewise. (small_global): Likewise. (large_global): Likewise.
2020-11-16libstdc++: Fix error shown during Solaris buildJonathan Wakely2-4/+4
Currently this is shown when building libstdc++ on Solaris: -lrt: open: No such file or directory The error comes from the make_sunver.pl script which tries to open each of its arguments. The arguments are passed by this make rule: perl ${glibcxx_srcdir}/scripts/make_exports.pl \ libstdc++-symbols.ver \ $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \ `echo $(libstdc___la_LIBADD) | \ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \ > $@ || (rm -f $@ ; exit 1) The $(libstdc___la_LIBADD) variable includes $(GLIBCXX_LIBS) which contains -lrt on Solaris. This patch adds another sed script to filter -l arguments from the echo command. In order to reliably match ' -l[^ ]* ' the echo arguments are quoted and a space added before and after them. This might be overkill just to remove -lrt from the start of the string, but should be robust in case other -l arguments are added to $(GLIBCXX_LIBS), or in case the $(libstdc___la_LIBADD) libraries are reordered. libstdc++-v3/ChangeLog: * src/Makefile.am (libstdc++-symbols.ver-sun): Remove -lrt from arguments passed to make_sunver.pl script. * src/Makefile.in: Regenerate.
2020-11-16Add .cache to git ignore.Martin Liska1-0/+1
ChangeLog: * .gitignore: Add cache as clangd uses it now.
2020-11-16gcov: Add -fprofile-info-section supportSebastian Huber5-2/+87
Register the profile information in the specified section instead of using a constructor/destructor. A pointer to the profile information generated by -fprofile-arcs or -ftest-coverage is placed in the specified section for each translation unit. This option disables the profile information registration through a constructor and it disables the profile information processing through a destructor. I am not sure how I can test this option. One approach would be to assemble a test file, then scan it and check that a .gcov_info section is present and no __gcov_init() and __gcov_exit() calls are present. Is there an example for this in the test suite? gcc/ * common.opt (fprofile-info-section): New. * coverage.c (build_gcov_info_var_registration): New. (coverage_obj_init): Evaluate profile_info_section and use build_gcov_info_var_registration(). * doc/invoke.texi (fprofile-info-section): Document. * opts.c (common_handle_option): Process fprofile-info-section option. gcc/testsuite/ChangeLog: * gcc.dg/profile-info-section.c: New test.
2020-11-16tree-optimization/97838 - fix SLP leaf detectionRichard Biener2-5/+28
This properly handles reduction PHI nodes with unrepresented initial value as leaf in the SLP graph. 2020-11-16 Richard Biener <rguenther@suse.de> PR tree-optimization/97838 * tree-vect-slp.c (vect_slp_build_vertices): Properly handle not backwards reachable cycles. (vect_optimize_slp): Check a node is leaf before marking it visited. * gcc.dg/vect/pr97838.c: New testcase.
2020-11-16Prefer bit-test over the jump table.Martin Liska3-8/+20
gcc/ChangeLog: PR tree-optimization/97736 * tree-switch-conversion.c (switch_decision_tree::analyze_switch_statement): Prefer bit tests. gcc/testsuite/ChangeLog: PR tree-optimization/97736 * gcc.dg/tree-ssa/switch-1.c: Prefer bit tests. * g++.dg/tree-ssa/pr97736.C: New test.
2020-11-16tree-optimization/97835 - fix step vector construction for SLP inductionRichard Biener2-1/+22
We're stripping conversions off access functions of inductions and thus the step can be of different sign. Fix bogus step CTORs by converting the elements rather than the whole vector. 2020-11-16 Richard Biener <rguenther@suse.de> PR tree-optimization/97835 * tree-vect-loop.c (vectorizable_induction): Convert step scalars rather than step vector. * gcc.dg/vect/pr97835.c: New testcase.
2020-11-16tree-optimization/97830 - fix compare of incomplete type size in VNRichard Biener2-1/+28
This avoids passing NULL to expressions_equal_p. 2020-11-16 Richard Biener <rguenther@suse.de> PR tree-optimization/97830 * tree-ssa-sccvn.c (vn_reference_eq): Check for incomplete types before comparing TYPE_SIZE. * gcc.dg/pr97830.c: New testcase.
2020-11-16Put PREFETCHW back to march=broadwellCui,Lili2-24/+29
PREFETCHW should be both in march=broadwell and march=silvermont. I move PREFETCHW from march=broadwell to march=silvermont in previous patch. gcc/ChangeLog: * config/i386/i386.h: Add PREFETCHW to march=broadwell. * doc/invoke.texi: Put PREFETCHW back to relation arch.
2020-11-16Daily bump.GCC Administrator6-1/+118
2020-11-15MSP430: Fix inconsistent naming of hwmult libfuncsJozef Lawrynowicz3-29/+7
The naming scheme used by GCC to reference MSP430 hardware multiply library functions is inconsistent. Sometimes the "GCC" names (e.g. mulsi2) are used, other times the "MSPABI" names (e.g. __mspabi_mpyl) are used. Also, sometimes an identifier for the hardware multiply support is appended to the GCC name, when the functions are defined, but this is not required. This patch fixes those issues, so the names used to refer to the hardware multiply library functions follow a consistent pattern. gcc/ChangeLog: * config/msp430/msp430.c (msp430_output_labelref): Don't process mspabi hwmult library function names into GCC-style names. libgcc/ChangeLog: * config/msp430/lib2hw_mul.S: Omit _hw* suffix from GCC names for hwmult library functions. gcc/testsuite/ChangeLog: * gcc.target/msp430/rtx-cost-Os-f5series.c: Adjust test to use new hwmult library function name.