aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-05-26do not skip validation of switch after %<optAlexandre Oliva2-12/+30
After the patch that revamped dump and aux outputs, GCC compilation drivers built without Ada would reject -d* options. Such options would only be validated because of the %{d*} in Ada lang specs, though other languages had it as well. Other languages had %< specs that had to be there before %{d*} %:dumps(), while Ada was missing them. Adding them to Ada brought the same problem to compilers that had Ada enabled. The reason validation failed was that they mishandled %< specs, advancing past the beginning of the next spec, causing it not to be handled. Since %{d*} appeared after an odd %<, it was thus ignored. The logic of validate_switches originally skipped the closing brace that matched the opening brace, but this shouldn't happen for %<. Fixed by letting validate_switches know whether it is handling a braced group or a single atom, and behaving accordingly. gcc/ChangeLog: * gcc.c (validate_switches): Add braced parameter. Adjust all callers. Expected and skip trailing brace only if braced. Return after handling one atom otherwise. (DUMPS_OPTIONS): New. (cpp_debug_options): Define in terms of it. gcc/ada/ChangeLog: * gcc-interface/lang-specs.h (ADA_DUMPS_OPTIONS): Define in terms of DUMPS_OPTIONS. Replace occurrences of %{d*} %:dumps with it.
2020-05-26tree-optimization/95327 - fix another vectorizable_shift const SLP opRichard Biener1-2/+8
This fixes another case where we fail to set the type on a SLP constant operand in vectorizable_shift. 2020-05-26 Richard Biener <rguenther@suse.de> PR tree-optimization/95327 * tree-vect-stmts.c (vectorizable_shift): Compute op1_vectype when we are not using a scalar shift.
2020-05-26i386: Implement V2SI and V4HI shufflesUros Bizjak4-1/+135
2020-05-26 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: * config/i386/mmx.md (*mmx_pshufd_1): New insn pattern. * config/i386/i386-expand.c (ix86_vectorize_vec_perm_const): Handle E_V2SImode and E_V4HImode. (expand_vec_perm_even_odd_1): Handle E_V4HImode. Assert that E_V2SImode is already handled. (expand_vec_perm_broadcast_1): Assert that E_V2SImode is already handled by standard shuffle patterns. gcc/testsuite/ChangeLog: * gcc.target/i386/vperm-v2si.c: New test. * gcc.target/i386/vperm-v4hi.c: Ditto.
2020-05-26coroutines, testsuite: Fix co-ret-17-void-ret-coro.C.Iain Sandoe1-4/+8
This was a bad testcase, found with fsanitize=address; the final suspend is 'suspend never' which flows off the end of the coroutine destroying the promise and the frame. At that point access via the handle is an error. Fixed by checking that the promise is destroyed via a global var. gcc/testsuite/ChangeLog: * g++.dg/coroutines/torture/co-ret-17-void-ret-coro.C: Check for promise destruction via a global variable.
2020-05-26Simplify types of TYPE_VALUES in enumeral typesJan Hubicka1-2/+22
streaming code assumes that INTEGER_CST never appears in non-trivial component. This is not true and we sometimes stream such components which sort of silently works but breaks our IL invariant about tree sharing. This patch fixes one instance of this problem where ENUMERAL_TYPE lists all its valids in TYPE_VALUES that with some FEs (like Ada and C++) are having the enumeral type as a type while in other FEs (like C) are simple integer types. I convert them all to integers which also increases chance that they will be shared with other integer constants at stream time. gcc/ * tree.c (free_lang_data_in_type): Simpify types of TYPE_VALUES in enumeral types.
2020-05-26openmp: Ensure copy ctor for composite distribute parallel for class ↵Jakub Jelinek4-57/+120
iterators is instantiated [PR95197] During gimplification omp_finish_clause langhook is called in several places to add the language specific info to the clause like what default/copy ctors, dtors and assignment operators should be used. Unfortunately, if it refers to some not yet instantiated method, during gimplification it is too late and the methods will not be instantiated anymore. For other cases, the genericizer has code to detect those and instantiate whatever is needed, this change adds the same for distribute parallel for class iterators where we under the hood need a copy constructor for the iterator to implement it. 2020-05-26 Jakub Jelinek <jakub@redhat.com> PR c++/95197 * gimplify.c (find_combined_omp_for): Move to omp-general.c. * omp-general.h (find_combined_omp_for): Declare. * omp-general.c: Include tree-iterator.h. (find_combined_omp_for): New function, moved from gimplify.c. * cp-gimplify.c: Include omp-general.h. (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration variables in composite distribute parallel for, instantiate copy ctor of their types.
2020-05-26revamp dump and aux output namesAlexandre Oliva19-408/+2024
This patch simplifies (!!!) the logic governing the naming of dump files and auxiliary output files in the driver, in the compiler, and in the LTO wrapper. No changes are made to the naming of primary outputs, there are often ways to restore past behavior, and a number of inconsistencies are fixed. Some internal options are removed (-auxbase and -auxbase-strip), sensible existing uses of -dumpdir and -dumpbase options remain unchanged, additional useful cases are added, making for what is still admittedly quite complex. Extensive documentation and testcases provide numerous examples, from normal to corner cases. The most visible changes are: - aux and dump files now always go in the same directory, that defaults to the directory of the primary output, but that can be overridden with -dumpdir, -save-temps=*, or, preserving past behavior, with a -dumpbase with a directory component. - driver and compiler now have the same notion of naming of auxiliary outputs, e.g. .dwo files will no longer be in one location while the debug info suggests they are elsewhere, and -save-temps and .dwo auxiliary outputs now go in the same location as .su, .ci and coverage data, with consistent naming. - explicitly-specified primary output names guide not only the location of aux and dump outputs: the output base name is also used in their base name, as a prefix when also linking (e.g. foo.c bar.c -o foobar creates foobar-foo.dwo and foobar-bar.dwo with -gsplit-dwarf), or as the base name instead of the input name (foo.c -c -o whatever.o creates whatever.su rather than foo.su with -fstack-usage). The preference for the input file base name, quite useful for our testsuite, can be restored with -dumpbase "". When compiling and linking tests in the testsuite with additional inputs, we now use this flag. Files named in dejagnu board ldflags, libs, and ldscripts are now quoted in the gcc testsuite with -Wl, so that they are not counted as additional inputs by the compiler driver. - naming a -dumpbase when compiling multiple sources used to cause dumps from later compiles to overwrite those of earlier ones; it is now used as a prefix when compiling multiple sources, like an executable name above. - the dumpbase, explicitly specified or computed from output or input names, now also governs the naming of aux outputs; since aux outputs usually replaced the suffix from the input name, while dump outputs append their own additional suffixes, a -dumpbase-ext option is introduced to enable a chosen suffix to be dropped from dumpbase to form aux output names. - LTO dump and aux outputs were quite a mess, sometimes leaking temporary output names into -save-temps output names, sometimes conversely generating desirable aux outputs in temporary locations. They now obey the same logic of compiler aux and dump outputs, landing in the expected location and taking the linker output name or an explicit dumpbase overrider into account. - Naming of -fdump-final-insns outputs now follows the dump file naming logic for the .gkd files, and the .gk dump files generated in the second -fcompare-debug compilation get the .gk inserted before the suffix that -dumpbase-ext drops in aux outputs. gcc/ChangeLog: * common.opt (aux_base_name): Define. (dumpbase, dumpdir): Mark as Driver options. (-dumpbase, -dumpdir): Likewise. (dumpbase-ext, -dumpbase-ext): New. (auxbase, auxbase-strip): Drop. * doc/invoke.texi (-dumpbase, -dumpbase-ext, -dumpdir): Document. (-o): Introduce the notion of primary output, mention it influences auxiliary and dump output names as well, add examples. (-save-temps): Adjust, move examples into -dump*. (-save-temps=cwd, -save-temps=obj): Likewise. (-fdump-final-insns): Adjust. * dwarf2out.c (gen_producer_string): Drop auxbase and auxbase_strip; add dumpbase_ext. * gcc.c (enum save_temps): Add SAVE_TEMPS_DUMP. (save_temps_prefix, save_temps_length): Drop. (save_temps_overrides_dumpdir): New. (dumpdir, dumpbase, dumpbase_ext): New. (dumpdir_length, dumpdir_trailing_dash_added): New. (outbase, outbase_length): New. (The Specs Language): Introduce %". Adjust %b and %B. (ASM_FINAL_SPEC): Use %b.dwo for an aux output name always. Precede object file with %w when it's the primary output. (cpp_debug_options): Do not pass on incoming -dumpdir, -dumpbase and -dumpbase-ext options; recompute them with %:dumps. (cc1_options): Drop auxbase with and without compare-debug; use cpp_debug_options instead of dumpbase. Mark asm output with %w when it's the primary output. (static_spec_functions): Drop %:compare-debug-auxbase-opt and %:replace-exception. Add %:dumps. (driver_handle_option): Implement -save-temps=*/-dumpdir mutual overriding logic. Save dumpdir, dumpbase and dumpbase-ext options. Do not save output_file in save_temps_prefix. (adds_single_suffix_p): New. (single_input_file_index): New. (process_command): Combine output dir, output base name, and dumpbase into dumpdir and outbase. (set_collect_gcc_options): Pass a possibly-adjusted -dumpdir. (do_spec_1): Optionally dumpdir instead of save_temps_prefix, and outbase instead of input_basename in %b, %B and in -save-temps aux files. Handle empty argument %". (driver::maybe_run_linker): Adjust dumpdir and auxbase. (compare_debug_dump_opt_spec_function): Adjust gkd dump file naming. Spec-quote the computed -fdump-final-insns file name. (debug_auxbase_opt): Drop. (compare_debug_self_opt_spec_function): Drop auxbase-strip computation. (compare_debug_auxbase_opt_spec_function): Drop. (not_actual_file_p): New. (replace_extension_spec_func): Drop. (dumps_spec_func): New. (convert_white_space): Split-out parts into... (quote_string, whitespace_to_convert_p): ... these. New. (quote_spec_char_p, quote_spec, quote_spec_arg): New. (driver::finalize): Release and reset new variables; drop removed ones. * lto-wrapper.c (HAVE_TARGET_EXECUTABLE_SUFFIX): Define if... (TARGET_EXECUTABLE_SUFFIX): ... is defined; define this to the empty string otherwise. (DUMPBASE_SUFFIX): Drop leading period. (debug_objcopy): Use concat. (run_gcc): Recognize -save-temps=* as -save-temps too. Obey -dumpdir. Pass on empty dumpdir and dumpbase with a directory component. Simplify temp file names. * opts.c (finish_options): Drop aux base name handling. (common_handle_option): Drop auxbase-strip handling. * toplev.c (print_switch_values): Drop auxbase, add dumpbase-ext. (process_options): Derive aux_base_name from dump_base_name and dump_base_ext. (lang_dependent_init): Compute dump_base_ext along with dump_base_name. Disable stack usage and callgraph-info during lto generation and compare-debug recompilation. gcc/fortran/ChangeLog: * options.c (gfc_get_option_string): Drop auxbase, add dumpbase_ext. gcc/ada/ChangeLog: * gcc-interface/lang-specs.h: Drop auxbase and auxbase-strip. Use %:dumps instead of -dumpbase. Add %w for implicit .s primary output. * switch.adb (Is_Internal_GCC_Switch): Recognize dumpdir and dumpbase-ext. Drop auxbase and auxbase-strip. lto-plugin/ChangeLog: * lto-plugin.c (skip_in_suffix): New. (exec_lto_wrapper): Use skip_in_suffix and concat to build non-temporary output names. (onload): Look for -dumpdir in COLLECT_GCC_OPTIONS, and override link_output_name with it. contrib/ChangeLog: * compare-debug: Adjust for .gkd files named as dump files, with the source suffix rather than the object suffix. gcc/testsuite/ChangeLog: * gcc.misc-tests/outputs.exp: New. * gcc.misc-tests/outputs-0.c: New. * gcc.misc-tests/outputs-1.c: New. * gcc.misc-tests/outputs-2.c: New. * lib/gcc-defs.exp (gcc_adjusted_linker_flags): New. (gcc_adjust_linker_flags): New. (dg-additional-files-options): Call it. Pass -dumpbase "" when there are additional sources. * lib/profopt.exp (profopt-execute): Pass the executable suffix with -dumpbase-ext. * lib/scandump.exp (dump-base): Mention -dumpbase "" use. * lib/scanltranstree.exp: Adjust dump suffix expectation. * lib/scanwpaipa.exp: Likewise.
2020-05-26Revert "Add ChangeLog entry for my last commit."Martin Liska2-23/+0
This reverts commit cfdff3eeb902958d3eefe60d5712d64e2367843f.
2020-05-26Add ChangeLog entry for my last commit.misc/first-auto-changelogliuhongt2-0/+23
2020-05-26Fix non-comforming expander for ↵liuhongt4-15/+90
floatv2div2sf2,floatunsv2div2sf2,fix_truncv2sfv2di,fixuns_truncv2sfv2di. 2020-05-26 Hongtao Liu <hongtao.liu@intel.com> Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/95211 PR target/95256 * config/i386/sse.md (<floatunssuffix>v2div2sf2): New expander. (fix<fixunssuffix>_truncv2sfv2di2): Ditto. (avx512dq_float<floatunssuffix>v2div2sf2): Renaming from float<floatunssuffix>v2div2sf2. (avx512dq_fix<fixunssuffix>_truncv2sfv2di2<mask_name>): Renaming from fix<fixunssuffix>_truncv2sfv2di2<mask_name>. (vec_pack<floatprefix>_float_<mode>): Adjust icode name. (vec_unpack_<fixprefix>fix_trunc_lo_<mode>): Ditto. (vec_unpack_<fixprefix>fix_trunc_hi_<mode>): Ditto. * config/i386/i386-builtin.def: Ditto. * emit-rtl.c (validate_subreg): Allow use of *paradoxical* vector subregs when both omode and imode are vector mode and have the same inner mode. gcc/testsuite/ChangeLog * gcc.target/i386/pr95211.c: New test.
2020-05-26Daily bump.GCC Administrator1-1/+1
2020-05-25libgo: update x/sys/cpu after gccgo support addedClément Chigot1-1/+1
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/234597
2020-05-25Fix internal error on store to FP component at -O2Eric Botcazou4-4/+103
This is about a GIMPLE verification failure at -O2 or above because the GIMPLE store merging pass generates a NOP_EXPR between a FP type and an integral type. This happens when the bit-field insertion path is taken for a FP field, which can happen in Ada for bit-packed record types. It is fixed by generating an intermediate VIEW_CONVERT_EXPR. The patch also tames a little the bit-field insertion path because, for bit-packed record types in Ada, you can end up with large bit-field regions, which results in a lot of mask-and-shifts instructions. gcc/ChangeLog * gimple-ssa-store-merging.c (merged_store_group::can_be_merged_into): Only turn MEM_REFs into bit-field stores for small bit-field regions (imm_store_chain_info::output_merged_store): Be prepared for sources with non-integral type in the bit-field insertion case. (pass_store_merging::process_store): Use MAX_BITSIZE_MODE_ANY_INT as the largest size for the bit-field case. gcc/testsuite/ChangeLog * gnat.dg/opt84.adb: New test.
2020-05-25i386: Remove broadcasts from TARGET_MMX_WITH_SSE vec_dup insn patternsUros Bizjak11-121/+53
XMM broadcast instructions broadcast value from general reg to all elements of the vector. This is not allowed for TARGET_MMX_WITH_SSE, where it is expected that bits outside lower 64bits load or retain zero value. Following testcases expect broadcast, and are thus invalid: FAIL: gcc.target/i386/sse2-mmx-18b.c scan-assembler-not movd FAIL: gcc.target/i386/sse2-mmx-18b.c scan-assembler-times pbroadcastd 1 FAIL: gcc.target/i386/sse2-mmx-19b.c scan-assembler-not movd FAIL: gcc.target/i386/sse2-mmx-19b.c scan-assembler-times pbroadcastw 1 FAIL: gcc.target/i386/sse2-mmx-19d.c scan-assembler-times pbroadcastw 1 FAIL: gcc.target/i386/sse2-mmx-19e.c scan-assembler-times pbroadcastw 1 These testcases are removed entirely. 2020-05-25 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: * config/i386/mmx.md (*vec_dupv2sf): Redefine as define_insn. (mmx_pshufw_1): Change Yv constraint to xYw. Correct type attribute. (*vec_dupv4hi): Redefine as define_insn. Remove alternative with general register input. (*vec_dupv2si): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/sse2-mmx-18a.c (dg-options): Remove -mno-avx512vl. * gcc.target/i386/sse2-mmx-19a.c (dg-options): Remove -mno-avx. * gcc.target/i386/sse2-mmx-18b.c: Remove. * gcc.target/i386/sse2-mmx-18c.c: Ditto. * gcc.target/i386/sse2-mmx-19b.c: Ditto. * gcc.target/i386/sse2-mmx-19c.c: Ditto. * gcc.target/i386/sse2-mmx-19d.c: Ditto. * gcc.target/i386/sse2-mmx-19e.c: Ditto.
2020-05-25BRIG FE testsuite: Fix dump scan patterns in packed.hsail testMartin Jambor2-2/+6
Starting with r11-165-eb72dc663e9 which converted DECL_GIMPLE_REG_P to DECL_NOT_GIMPLE_REG_P we have failing BRIG testcase: -PASS: packed.hsail.brig scan-tree-dump gimple "_[0-9]+ = q2 \\+ q3;" -PASS: packed.hsail.brig scan-tree-dump gimple "= VEC_PERM_EXPR <new_output.[0-9]+_[0-9]+, [a-z0-9_]+, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;" +FAIL: packed.hsail.brig scan-tree-dump gimple "_[0-9]+ = q2 \\+ q3;" +FAIL: packed.hsail.brig scan-tree-dump gimple "= VEC_PERM_EXPR <new_output.[0-9]+_[0-9]+, [a-z0-9_]+, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>;" because the gimplifier is now smarter and generates nicer code, which however, does not match the regexp in the testsuite: --- before/packed.hsail.brig.005t.gimple 2020-05-12 17:59:26.434305513 +0200 +++ after/packed.hsail.brig.005t.gimple 2020-05-12 17:52:34.477055987 +0200 @@ -109,277 +109,267 @@ q2 = q1 + _24; _25 = VEC_PERM_EXPR <q1, q1, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }>; q3 = q2 + _25; - _26 = q2 + q3; - new_output.11 = _26; - new_output.21_27 = new_output.11; - _28 = VEC_PERM_EXPR <new_output.21_27, q4, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>; - s_output.12 = _28; + new_output.11 = q2 + q3; + s_output.12 = VEC_PERM_EXPR <new_output.11, q4, { 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }>; q4 = s_output.12; I have looked at the SSA dump and verified that the variable in question is a gimple register because it gets its SSA name. I have not looked into why the gimplifier previously though it had to go through the additional temporaries though. Tested with make -k check-brig. * brig.dg/test/gimple/packed.hsail: Fix scan dump patterns.
2020-05-25tree-optimization/95309 - fix invariant SLP node costingRichard Biener2-13/+35
This makes sure to compute SLP_TREE_NUMBER_OF_VEC_STMTS during SLP analysis even for invariant / external nodes so costing properly knows what to cost. 2020-05-25 Richard Biener <rguenther@suse.de> PR tree-optimization/95309 * tree-vect-slp.c (vect_get_constant_vectors): Move number of vector computation ... (vect_slp_analyze_node_operations): ... to analysis phase.
2020-05-25[Ada] Fix spurious error on checking of null Abstract_StateYannick Moy2-3/+12
2020-05-25 Yannick Moy <moy@adacore.com> gcc/ada/ * sem_util.adb (Check_No_Hidden_State): Stop propagation at first block/task/entry.
2020-05-25[Ada] Change pragma Compile_Time_Error to force compile-time evaluationYannick Moy7-29/+99
2020-05-25 Yannick Moy <moy@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Document changes to pragmas Compile_Time_Error/Compile_Time_Warning. * gnat_rm.texi: Regenerate. * libgnat/g-bytswa.adb: Change uses of Compile_Time_Error to Compile_Time_Warning, as the actual expression may not always be known statically. * sem_prag.adb (Analyze_Pragma): Handle differently pragma Compile_Time_Error in both compilation and in GNATprove mode. (Validate_Compile_Time_Warning_Or_Error): Issue an error or warning when the expression is not known at compile time. * usage.adb: Add missing documentation for warning switches _c and _r. * warnsw.ads: Update comment.
2020-05-25[Ada] Spurious accessibility error on return aggregate in GNATprove modeJustin Squirek2-12/+17
2020-05-25 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_ch6.adb (Check_Return_Obj_Accessibility): Use original node to avoid looking at expansion done in GNATprove mode.
2020-05-25Do not stream redundant stuffJan Hubicka5-10/+31
as discussed on IRC this adds knob to disable stuff we stream "just for fun" (or to make it easier to debug streamer desychnonization). Te size of .o files in gcc subdirectory is reduced form 506MB to 492MB gcc/ * lto-streamer-out.c (lto_output_tree): Add streamer_debugging check. * lto-streamer.h (streamer_debugging): New constant * tree-streamer-in.c (streamer_read_tree_bitfields): Add streamer_debugging check. (streamer_get_pickled_tree): Likewise. * tree-streamer-out.c (pack_ts_base_value_fields): Likewise.
2020-05-25tree-optimization/95308 - really avoid forward propagating of &TMRRichard Biener2-0/+11
This fixes a hole that still allowed forwarding of TARGET_MEM_REF addresses. 2020-05-25 Richard Biener <rguenther@suse.de> PR tree-optimization/95308 * tree-ssa-forwprop.c (pass_forwprop::execute): Generalize test for TARGET_MEM_REFs. * g++.dg/torture/pr95308.C: New testcase.
2020-05-25tree-optimization/95295 - fix wrong-code with SMRichard Biener6-0/+69
We failed to compare the rematerialized store values when merging paths after walking PHIs. 2020-05-25 Richard Biener <rguenther@suse.de> PR tree-optimization/95295 * tree-ssa-loop-im.c (sm_seq_valid_bb): Compare remat stores RHSes and drop to full sm_other if they are not equal. * gcc.dg/torture/pr95295-1.c: New testcase. * gcc.dg/torture/pr95295-2.c: Likewise. * gcc.dg/torture/pr95283.c: Likewise.
2020-05-25tree-optimization/95271 - fix bswap vectorization invariant SLP typeRichard Biener4-1/+42
This properly updates invariant SLP nodes vector types for bswap vectorization. 2020-05-25 Richard Biener <rguenther@suse.de> PR tree-optimization/95271 * tree-vect-stmts.c (vectorizable_bswap): Update invariant SLP children vector type. (vectorizable_call): Pass down slp ops. * gcc.dg/vect/bb-slp-pr95271.c: New testcase.
2020-05-25tree-optimization/95297 - handle scalar shift arg for SLP invariant vectypeRichard Biener5-1/+61
This skips invariant vector type setting for a scalar shift argument. 2020-05-25 Richard Biener <rguenther@suse.de> PR tree-optimization/95297 * tree-vect-stmts.c (vectorizable_shift): For scalar_shift_arg skip updating operand 1 vector type. * g++.dg/vect/pr95297.cc: New testcase. * g++.dg/vect/pr95290.cc: Likewise.
2020-05-25tree-optimization/95308 - really avoid forward propagating of &TMRRichard Biener2-7/+28
This fixes a hole that still allowed forwarding of TARGET_MEM_REF addresses. 2020-05-25 Richard Biener <rguenther@suse.de> PR tree-optimization/95308 * tree-ssa-forwprop.c (pass_forwprop::execute): Generalize test for TARGET_MEM_REFs. * g++.dg/torture/pr95308.C: New testcase.
2020-05-25tree-optimization/95284 - amend previous store commoning fixRichard Biener4-1/+28
Generalize check for clobbers. 2020-05-25 Richard Biener <rguenther@suse.de> PR tree-optimization/95284 * tree-ssa-sink.c (sink_common_stores_to_bb): Amend previous fix. * g++.dg/torture/pr95284.C: New testcase.
2020-05-25Fix internal error on problematic renamingEric Botcazou5-46/+114
This is an internal renaming generated for a generalized loop iteration made on a tagged record type with predicate, and gigi cannot use the most efficient way of implementing renamings because the renamed object is an expression with a non-empty Actions list. gcc/ada/ChangeLog * gcc-interface/decl.c (gnat_to_gnu_entity): Add new local variable and use it throughout the function. <E_Variable>: Rename local variable and adjust accordingly. In the case of a renaming, materialize the entity if the renamed object is an N_Expression_With_Actions node. <E_Procedure>: Use Alias accessor function consistently. gcc/testsuite/ChangeLog * gnat.dg/renaming16.adb: New test. * gnat.dg/renaming16_pkg.ads: New helper.
2020-05-25Fix small fallout of earlier changeEric Botcazou2-0/+8
gcc/ada/ChangeLog * gcc-interface/misc.c (get_array_bit_stride): Get to the debug type, if any, before calling gnat_get_array_descr_info.
2020-05-25Fix missing back-annotation for derived typesEric Botcazou2-27/+53
Gigi fails to back-annotate the Present_Expr field of variants present in a type derived from a discriminated untagged record type, which is for example visible in the output -gnatRj. gcc/ada/ChangeLog * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: Tidy up. (build_variant_list): Add GNAT_VARIANT_PART parameter and annotate its variants if it is present. Adjust the recursive call by passing the variant subpart of variants, if any. (copy_and_substitute_in_layout): Rename GNU_SUBST_LIST to SUBST_LIST and adjust throughout. For a type, pass the variant part in the call to build_variant_list.
2020-05-25Fix incorrect handling of Component_SizeEric Botcazou5-3/+62
The compiler can mishandle a Component_Size clause on an array type specifying a size multiple of the storage unit, when this size is not a multiple of the alignment of the component type. gcc/ada/ChangeLog * gcc-interface/decl.c (gnat_to_gnu_component_type): Cap alignment of the component type according to the component size. gcc/testsuite/ChangeLog * gnat.dg/array40.adb: New test. * gnat.dg/array40_pkg.ads: New helper.
2020-05-25Change description of fat pointertype with -fgnat-encodings=minimalEric Botcazou4-91/+84
This makes a step back in the representation of fat pointer types in the debug info with -fgnat-encodings=minimal so as to avoid hiding the data indirection and making it easiser to synthetize the construct. gcc/ada/ChangeLog * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Array_Type>: Add a description of the various types associated with the unconstrained type. Declare the fat pointer earlier. Set the current function as context on the template type, and the fat pointer type on the array type. Always mark the fat pointer type as artificial and set it as the context for the pointer type to the array. Also reuse GNU_ENTITY_NAME. Finish up the unconstrained type at the very end. * gcc-interface/misc.c (gnat_get_array_descr_info): Do not handle fat pointer types and tidy up accordingly. * gcc-interface/utils.c (build_unc_object_type): Do not set the context on the template type.
2020-05-25Add missing ChangeLog entries in previous commitEric Botcazou2-0/+14
2020-05-25Fix wrong assignment to mutable Out parameter of task entryEric Botcazou6-31/+90
Under very specific circumstances the compiler can generate a wrong assignment to a mutable record object which contains an array component, because it does not correctly handle the update of the discriminant. gcc/ada/ChangeLog * gcc-interface/gigi.h (operand_type): New static inline function. * gcc-interface/trans.c (gnat_to_gnu): Do not suppress conversion to the resulty type at the end for array types. * gcc-interface/utils2.c (build_binary_op) <MODIFY_EXPR>: Do not remove conversions between array types on the LHS. gcc/testsuite/ChangeLog * gnat.dg/array39.adb: New test. * gnat.dg/array39_pkg.ads: New helper. * gnat.dg/array39_pkg.adb: Likewise.
2020-05-25Add missing expander for vector float_extend and float_truncate.liuhongt5-0/+90
2020-05-25 Hongtao Liu <hongtao.liu@intel.com> gcc/ChangeLog PR target/95125 * config/i386/sse.md (sf2dfmode_lower): New mode attribute. (trunc<mode><sf2dfmode_lower>2) New expander. (extend<sf2dfmode_lower><mode>2): Ditto. gcc/testsuite/ChangeLog * gcc.target/i386/pr95125-avx.c: New test. * gcc.target/i386/pr95125-avx512f.c: Ditto.
2020-05-25Daily bump.GCC Administrator1-1/+1
2020-05-24PR fortran/95106 - truncation of long symbol names with EQUIVALENCEHarald Anlauf4-2/+26
For long module names, the generated name-mangled symbol was truncated, leading to bogus warnings about COMMON block mismatches. Provide sufficiently large temporaries. gcc/fortran/ 2020-05-24 Harald Anlauf <anlauf@gmx.de> PR fortran/95106 * trans-common.c (gfc_sym_mangled_common_id): Enlarge temporaries for name-mangling. gcc/testsuite/ 2020-05-24 Harald Anlauf <anlauf@gmx.de> PR fortran/95106 * gfortran.dg/equiv_11.f90: New test.
2020-05-24Daily bump.GCC Administrator1-1/+1
2020-05-23c++: Avoid concept evaluation when uid-sensitive [PR94038]Patrick Palka4-1/+29
Concept evaluation may entail DECL_UID generation and/or template instantiation, so in general we can't perform it during uid-sensitive constexpr evaluation. gcc/cp/ChangeLog: PR c++/94038 * constexpr.c (cxx_eval_constant_expression) <case TEMPLATE_ID_EXPR>: Don't evaluate the concept when constexpr evaluation is uid-sensitive. gcc/testsuite/ChangeLog: PR c++/94038 * g++.dg/warn/pr94038-3.C: New test.
2020-05-23Fixes a hang on an invalid ID in a WAIT statement.Thomas Koenig2-0/+7
gcc/fortran/ChangeLog: 2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95191 * libgfortran.h (libgfortran_error_codes): Add LIBERROR_BAD_WAIT_ID. libgfortran/ChangeLog: 2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95191 * io/async.c (async_wait_id): Generate error if ID is higher than the highest current ID. * runtime/error.c (translate_error): Handle LIBERROR_BAD_WAIT_ID. libgomp/ChangeLog: 2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95191 * testsuite/libgomp.fortran/async_io_9.f90: New test.
2020-05-23Darwin: Make sanitizer local vars linker-visible.Iain Sandoe2-0/+11
Another case where we need a linker-visible symbols in order to preserve the ld64 atom model. If these symbols are emitted as 'local' the linker cannot see that they are separate from any global weak entry that precedes them. This will cause the linker to complain that there is (apparently) direct access to such a weak global, preventing it from being replaced. This is a short-term fix for the problem - we need generic handling for relevant cases (that also does not pessimise objects by emitting unnecessary symbols and relocations). gcc/ChangeLog: 2020-05-23 Iain Sandoe <iain@sandoe.co.uk> * config/darwin.h (ASM_GENERATE_INTERNAL_LABEL): Make ubsan_{data,type},ASAN symbols linker-visible.
2020-05-23Adjust typo in testcase of my last commitliuhongt1-1/+1
gcc/testsuite/ChangeLog * gcc.target/i386/pr92658-avx512vl.c: Fix typo.
2020-05-22c++: Fix C++17 eval order for virtual op=.Jason Merrill2-0/+19
In a function call expression in C++17 evaluation of the function pointer is sequenced before evaluation of the function arguments, but that doesn't apply to function calls that were written using operator syntax. In particular, for operators with right-to-left ordering like assignment, we must not evaluate the LHS to find a virtual function before we evaluate the RHS. gcc/cp/ChangeLog: * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Don't preevaluate the function address if the call used operator syntax. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/eval-order9.C: New test.
2020-05-23Daily bump.GCC Administrator1-1/+1
2020-05-22Suggest including <stdint.h> or <cstdint> for [u]int[8|16|32|64]_tMark Wielaard5-6/+176
Plus [u]intptr_t and associated constants. Refactor the bool, true, false, <stdbool.h> code so it fits into the new table based design. gcc/c-family/ChangeLog: * known-headers.cc (get_stdlib_header_for_name): Add a new stdlib_hint array for stdbool and stdint. gcc/testsuite/ChangeLog: * gcc.dg/spellcheck-stdint.c: New test. * g++.dg/spellcheck-stdint.C: Likewise.
2020-05-22Suggest including <stdbool.h> for bool, true and falseMark Wielaard4-0/+35
Currently gcc suggests to use _Bool instead of bool and doesn't give any suggestions when true or false are used, but undefined. This patch makes it so that (for C99 or higher) a fixit hint is emitted to include <stdbool.h>. gcc/c-family/ChangeLog: * known-headers.cc (get_stdlib_header_for_name): Return "<stdbool.h>" for "bool", "true" or "false" when STDLIB_C and flag_isoc99. gcc/testsuite/ChangeLog: * gcc.dg/spellcheck-stdbool.c: New test.
2020-05-22c++: -fsanitize=vptr and -fstrong-eval-order. [PR95221]Jason Merrill14-10/+39
With -fstrong-eval-order=all we evaluate the function address before the arguments. But this caused trouble with virtual functions and -fsanitize=vptr; we would do vptr sanitization as part of calculating the 'this' argument, and separately look at the vptr in order to find the function address. Without -fstrong-eval-order=all 'this' is evaluated first, but with that flag the function address is evaluated first, so we would access the null vptr before sanitizing it. Fixed by instrumenting the OBJ_TYPE_REF of a virtual function call instead of the 'this' argument. This issue suggests that we should be running the ubsan tests in multiple standard modes like the rest of the G++ testsuite, so I've made that change as well. gcc/cp/ChangeLog: * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): For a virtual call, instrument the OBJ_TYPE_REF. gcc/testsuite/ChangeLog: * g++.dg/ubsan/ubsan.exp: Use g++-dg-runtest. * c-c++-common/ubsan/bounds-13.c: Adjust. * c-c++-common/ubsan/bounds-2.c: Adjust. * c-c++-common/ubsan/div-by-zero-1.c: Adjust. * c-c++-common/ubsan/div-by-zero-6.c: Adjust. * c-c++-common/ubsan/div-by-zero-7.c: Adjust. * c-c++-common/ubsan/overflow-add-1.c: Adjust. * c-c++-common/ubsan/overflow-add-2.c: Adjust. * c-c++-common/ubsan/overflow-int128.c: Adjust. * c-c++-common/ubsan/overflow-sub-1.c: Adjust. * c-c++-common/ubsan/overflow-sub-2.c: Adjust. * g++.dg/ubsan/pr85029.C: Adjust. * g++.dg/ubsan/vptr-14.C: Adjust.
2020-05-22analyzer: Add exit, and _exit replacement, to sm-signal.Mark Wielaard4-4/+72
Warn about using exit in signal handler and suggest _exit as alternative. gcc/analyzer/ChangeLog: * sm-signal.cc(signal_unsafe_call::emit): Possibly add gcc_rich_location note for replacement. (signal_unsafe_call::get_replacement_fn): New private function. (get_async_signal_unsafe_fns): Add "exit". gcc/testsuite/ChangeLog: * gcc.dg/analyzer/signal-exit.c: New testcase.
2020-05-22Silence warning introduced by my previous change.Jan Hubicka2-2/+5
* lto-streamer-out.c (DFS::DFS): Silence warning.
2020-05-22i386: Fix <rounding_insn><mode>2 expander [PR95255]Uros Bizjak4-5/+26
2020-05-22 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/95255 * config/i386/i386.md (<rounding_insn><mode>2): Do not try to expand non-sse4 ROUND_ROUNDEVEN rounding via SSE support routines. gcc/testsuite/ChangeLog: PR target/95255 * gcc.target/i386/pr95255.c: New test.
2020-05-22Avoid streaming stray references.Jan Hubicka4-18/+21
this patch avoids stremaing completely useless stray references to gobal decl stream. I am re-testing the patch (rebased to current tree) on x86_64-linux and intend to commit once testing finishes. gcc/ChangeLog: 2020-05-22 Jan Hubicka <hubicka@ucw.cz> * lto-streamer-out.c (lto_output_tree): Do not stream final ref if it is not needed. gcc/lto/ChangeLog: 2020-05-22 Jan Hubicka <hubicka@ucw.cz> * lto-common.c (lto_read_decls): Do not skip stray refs.