aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2019-09-05[Darwin, PPC, testsuite] Add requires for DFP to two tests.Iain Sandoe3-1/+11
The two tests use decimal floating point, add the relevant dg-requires so that they are unsupported on platforms without DFP. 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-06-22 Iain Sandoe <iain@sandoe.co.uk> * gcc.target/powerpc/pr64205.c: Require effective target dfp. * gcc.target/powerpc/pr79909.c: Likewise. From-SVN: r275435
2019-09-05[Darwin, PPC, testsuite] Fix darwin-bool-1.c.Iain Sandoe2-0/+10
This test is failing because of a pedantic warning that is unrelated to the purpose of the test. Fixed by suppressing that warning. 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-06-22 Iain Sandoe <iain@sandoe.co.uk> * gcc.target/powerpc/darwin-bool-1.c: Suppress the pedantic warning about _Bool. From-SVN: r275434
2019-09-05[Darwin, PPC] Fix fail of cpp/assert4.cIain Sandoe2-2/+29
This test needs the cpu and machine asserts to be implemented which hadn't been done for PPC Darwin. We also need to emit __PPC__ for 32/64b and __PPC64__, __powerpc64__ (64bit) as per the other members of the PowerPC port. 2019-08-27 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-08-18 Iain Sandoe <iain@sandoe.co.uk> * config/rs6000/darwin.h (TARGET_OS_CPP_BUILTINS): Add asserts for cpu and machine. Factor 64/32b builtins. 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-08-18 Iain Sandoe <iain@sandoe.co.uk> * config/rs6000/darwin.h (TARGET_OS_CPP_BUILTINS): Add asserts for cpu and machine. Factor 64/32b builtins. Backport from mainline 2019-06-23 Iain Sandoe <iain@sandoe.co.uk> * config/rs6000/darwin.h: (__PPC__, __PPC64__): New. From-SVN: r275433
2019-09-05[c-family] Backport fix for PCH / PR61250.Iain Sandoe8-10/+48
When we are parsing a source file, the very first token might be a PRAGMA_GCC_PCH_PREPROCESS. This indicates that we are going read in a PCH file (named as the value of the pragma). If we don't see this pragma, then we know that it's OK to release any resources that the host might have set aside for the PCH file. There is a thinko in the current implementation, in that the decision to release resources is happening unconditionally right after the first token is extracted but before it's been checked or acted upon. This leads to the pch bug on Darwin, because we actually do release resources - which are subsequently (reasonably) assumed to be available when reading a PCH file. We then get random crashes or hangs depending on the interaction between unmmap and malloc. The bug is present everywhere but doesn't show on (say) Linux, since the release of PCH resources is a NOP there. This effects all the c-family front ends, because they all use c_lex_with_flags () to implement this. The solution is to check for the PRAGMA_GCC_PCH_PREPROCESS and only call c_common_no_more_pch () when that is not the first token. A secondary effect of the collection is that the name of the PCH file can be collected during the ggc_pch_read() reset of state. Therefore we should issue any diagnostic that might name the file before the collections are triggered. gcc/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> PR pch/61250 * ggc-page.c (ggc_pch_read): Read the ggc_pch_ondisk structure and issue any diagnostics needed before collecting the pre-PCH state. gcc/c-family/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> PR pch/61250 * c-lex.c (c_lex_with_flags): Don't call c_common_no_more_pch () from here. gcc/c 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> PR pch/61250 * c-parser.c (c_parse_file): Call c_common_no_more_pch () after determining that the first token is not PRAGMA_GCC_PCH_PREPROCESS. gcc/cp/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backported from mainline 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> PR pch/61250 * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch () after determining that the first token is not PRAGMA_GCC_PCH_PREPROCESS. From-SVN: r275431
2019-09-05[Darwin, X86, testsuite] Provide an asm shim for AVX512F tests.Iain Sandoe3-1/+102
Without this the tests fail to build. 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-05-10 Iain Sandoe <iain@sandoe.co.uk> * gcc.target/x86_64/abi/avx512f/abi-avx512f.exp: Darwin is now tested. * gcc.target/x86_64/abi/avx512f/asm-support-darwin.s: New. From-SVN: r275430
2019-09-05[Darwin] Fix PR87030 and tidy config fragments.Iain Sandoe12-30/+211
This is about 32/64b host and multilib support across the range of Darwin systems. Prior to Darwin8 (OS X 10.4), the toolchains support only PowerPC and only 32b. On Darwin8 it is possible to target a 64b multilib, but with support limited to a few of the main libraries on the system (not a recommended configuration). From Darwin9 to Darwin17 (OSX 10.5 to 10.13) it is possible to have either 32 or 64b hosted toolchains, with support for a 64 or 32b multilib respectively. On Darwin9 the kernel is 32b, but with support for 64b executables, so it's conventional to build a 32b host toolchain supporting a 64b multilib. However this is not enforced (merely a convention). There is also some platform hardware supporting Darwin10/11 which is only 32b and for which the same situation applies. However, from Darwin10 to Darwin17, the majority of platform hardware supports a 64b kernel and it's conventional to build a 64b host toolchain with support for a 32b multilib. On/from Darwin18 (OS X 10.14), the development headers (in the SDK) no longer expose the interfaces for the 32b multilib support (although sufficient runtime support remains installed that the testsuite can be run for a 32b multilib). The PR is raised against this latter situation since the absence of exposed interfaces causes a 'default' bootstrap fail regardless of the availability of the runtimes. Given the number of permutations, I felt it warranted a general solution, especially since the current scheme of target headers and t-make fragments has become somewhat messy. The changes here enforce the single 32b PowerPC multilib for Darwin < 8 and the single X86 64b multilib for Darwin >= 18. This means that there is no longer any need to configure Darwin18+ '--disable-multilib', but also that if you want to use the ability to continue to test the compiler's 32b multilib there, you need to make a configuration targeting an earlier OS version (and using the SDK from that). 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-07-24 Iain Sandoe <iain@sandoe.co.uk> PR bootstrap/87030 * config/i386/darwin.h (REAL_LIBGCC_SPEC): Revert change from r273749. PR bootstrap/87030 * config/i386/darwin.h (REAL_LIBGCC_SPEC): Move from here... * config/i386/darwin32-biarch.h .. to here. * config/i386/darwin64-biarch.h: Adjust comments. * config/rs6000/darwin32-biarch.h: Likewise. * config/rs6000/darwin64-biarch.h: Likewise. * config.gcc: Missed commit from r273746 (*-*-darwin*): Don't include CPU t-darwin here. (i[34567]86-*-darwin*): Adjust to use biarch files. Produce an error message if i686-darwin configuration is attempted for Darwin >= 18. Backport from mainline 2019-07-23 Iain Sandoe <iain@sandoe.co.uk> PR bootstrap/87030 * config.gcc (*-*-darwin*): Don't include CPU t-darwin here. (i[34567]86-*-darwin*): Adjust to use biarch files. Produce an error message if i686-darwin configuration is attempted for Darwin >= 18. (x86_64-*-darwin*): Switch to single multilib for Darwin >= 18. (powerpc-*-darwin*): Use biarch files where needed. (powerpc64-*-darwin*): Likewise. * config/i386/darwin.h (REAL_LIBGCC_SPEC): Move to new biarch file. (DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single arch case. * config/i386/darwin32-biarch.h: New. * config/i386/darwin64.h: Rename. * gcc/config/i386/darwin64-biarch.h: To this. * config/i386/t-darwin: Rename. * gcc/config/i386/t-darwin32-biarch: To this. * config/i386/t-darwin64: Rename. * gcc/config/i386/t-darwin64-biarch: To this. * config/rs6000/darwin32-biarch.h: New. * config/rs6000/darwin64.h: Rename. * config/rs6000/darwin64-biarch.h: To this. (DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single arch case. * config/rs6000/t-darwin8: Rename. * config/rs6000/t-darwin32-biarch: To this. * config/rs6000/t-darwin64 Rename. * config/rs6000/t-darwin64-biarch: To this. From-SVN: r275429
2019-09-05[ObjC] Recognise 'instancetype' as equivalent to 'id'.Iain Sandoe5-2/+63
This is primarily about fixing a number of testsuite fails, it implements the parsing of 'instancetype' but doesn't alter the code gen (relative to using id in the same position). It is part of the work-arounds for PR90709. gcc/objc/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-05-18 Iain Sandoe <iain@sandoe.co.uk> * objc/objc-act.h (OCTI_INSTANCE_TYPE, OCTI_INSTANCETYPE_NAME): New. (objc_global_trees): Add instance type and name. (INSTANCE_TYPEDEF_NAME): New. * objc/objc-act.c (synth_module_prologue): Build decls for objc_instancetype_type and objc_instancetype_name. gcc/testsuite/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-05-18 Iain Sandoe <iain@sandoe.co.uk> * objc.dg/instancetype-0.m: New. From-SVN: r275428
2019-09-05backport: [multiple changes]Richard Biener19-18/+247
2019-09-05 Richard Biener <rguenther@suse.de> * lto-streamer.h (LTO_minor_version): Bump. Backport from mainline 2019-05-06 Richard Biener <rguenther@suse.de> PR tree-optimization/90328 * tree-data-ref.h (dr_may_alias_p): Pass in the actual loop nest. * tree-data-ref.c (dr_may_alias_p): Check whether the clique is valid in the loop nest before using it. (initialize_data_dependence_relation): Adjust. * graphite-scop-detection.c (build_alias_set): Pass the SCOP enclosing loop as loop-nest to dr_may_alias_p. * gcc.dg/torture/pr90328.c: New testcase. 2019-03-08 Richard Biener <rguenther@suse.de> PR middle-end/89578 * cfgloop.h (struct loop): Add owned_clique field. * cfgloopmanip.c (copy_loop_info): Copy it. * tree-cfg.c (gimple_duplicate_bb): Do not remap owned_clique cliques. * tree-inline.c (copy_loops): Remap owned_clique. * lto-streamer-in.c (input_cfg): Stream owned_clique. * lto-streamer-out.c (output_cfg): Likewise. 2019-02-22 Richard Biener <rguenther@suse.de> PR tree-optimization/87609 * tree-cfg.c (gimple_duplicate_bb): Only remap inlined cliques. 2019-02-22 Richard Biener <rguenther@suse.de> PR middle-end/87609 * cfghooks.h (dependence_hash): New typedef. (struct copy_bb_data): New type. (cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument. (duplicate_block): Likewise. * cfghooks.c (duplicate_block): Pass down copy_bb_data. (copy_bbs): Create and pass down copy_bb_data. * cfgrtl.c (cfg_layout_duplicate_bb): Adjust. (rtl_duplicate_bb): Likewise. * tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL remap dependence info. * gcc.dg/torture/restrict-7.c: New testcase. 2019-02-22 Richard Biener <rguenther@suse.de> PR tree-optimization/87609 * tree-core.h (tree_base): Document special clique values. * tree-inline.c (remap_dependence_clique): Do not use the special clique value of one. (maybe_set_dependence_info): Use clique one. (clear_dependence_clique): New callback. (compute_dependence_clique): Clear clique one from all refs before assigning it (again). From-SVN: r275405
2019-09-05Daily bump.GCC Administrator1-1/+1
From-SVN: r275392
2019-09-04[Darwin] Make a final check on PIC options.Iain Sandoe2-2/+13
Final check on PCI options; for Darwin these are not dependent on the PIE ones, although PIE does require PIC to support it. Specifically, for Darwin, '-fPIC -fno-PIE' should result in the same as '-fno-PIE -fPIC'. This is a workaround for the situation in which a 'stock-built' GCC is unable to bootstrap m32 Darwin unless it's done '-mdynamic-no-pic'. So this fixes a bootstrap fail in that case. 2019-09-04 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-07-07 Iain Sandoe <iain@sandoe.co.uk> * config/darwin.c (darwin_override_options): Make a final check on PIC options. From-SVN: r275386
2019-09-04[Darwin] Don't jam symbol stubs on for kernel code.Iain Sandoe2-2/+8
Fix wrong code. Symbol stubs are needed only for m32 PPC, code and that is handled in rs6000.c. Symbol stubs should never have been generated for any X86 kernel-mode case. 2019-09-04 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-07-07 Iain Sandoe <iain@sandoe.co.uk> * config/darwin.c (darwin_override_options): Don't jam symbol stubs on for kernel code. From-SVN: r275385
2019-09-04[Darwin, PPC] Do not use longcall for 64b code.Iain Sandoe2-0/+17
Fix wrong codegen; the 'native' tools do no emit the longcall in this position. 2019-09-04 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-06-27 Iain Sandoe <iain@sandoe.co.uk> * config/rs6000/rs6000.c (darwin_rs6000_override_options): Do not use longcall for 64b code. From-SVN: r275384
2019-09-04[Darwin, Driver] Fix driver crashes with valid command line input.Iain Sandoe4-22/+171
Backport Improve processing of macosx-version-min= For PR target/63810 some improvements were made in the parsing of the version string at the point it's used to define the built-in __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__. This is fine, but the specs processing also uses the version, and specs version-compare doesn't like leading zeros on components. This means that while we succeed in processing -mmacosx-version-min=010.00002.000099 on compile lines, it fails for any other line that uses the value as part of a spec (in particular, link lines fail). To fix this, we need to apply a bit of clean-up to the version that's presented to the driver, and push that back into the command line opts. The value can come from four places: 1. User-entered on the command line 2. User-entered as MACOSX_DEPLOYMENT_TARGET= environment var. 3. Absent those two 3a For self-hosting systems, look-up from the kernel 3b For cross-compilers, as a default supplied at configure time. We apply the clean-up to all 4 (although it shouldn't really be needed for the cases under 3). We also supply a test-case that adapts to the target-version of the system, so that the link requirements are met by the SDK in use (if you try to link i686-darwin9 on an x86-64-darwin18 SDK, it will fail). gcc/ 2019-09-04 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-06-19 Iain Sandoe <iain@sandoe.co.uk> * config/darwin-driver.c (darwin_driver_init): Fix off-by-one errors in computing the number of options to be moved. Backport from mainline 2019-06-13 Iain Sandoe <iain@sandoe.co.uk> * config/darwin-driver.c (validate_macosx_version_min): New. (darwin_default_min_version): Cleanup and validate supplied version. (darwin_driver_init): Likewise and push cleaned version into opts. gcc/testsuite/ 2019-09-04 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-06-13 Iain Sandoe <iain@sandoe.co.uk> * gcc.dg/darwin-minversion-link.c: New test. From-SVN: r275382
2019-09-04backport: re PR tree-optimization/81740 (wrong code at -O3 in both 32-bit ↵Richard Biener5-1/+77
and 64-bit modes on x86_64-linux-gnu) 2019-09-04 Richard Biener <rguenther@suse.de> Backport from mainline 2019-03-26 Bin Cheng <bin.cheng@linux.alibaba.com> PR tree-optimization/81740 * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): In case of outer loop vectorization, check for backward dependence at the inner loop if outer loop dependence is reversed. * gcc.dg/vect/pr81740-1.c: New testcase. * gcc.dg/vect/pr81740-2.c: Likewise. From-SVN: r275372
2019-09-04backport: re PR tree-optimization/88149 (ICE in vect_transform_stmt since ↵Richard Biener4-2/+113
r265959) 2019-09-04 Richard Biener <rguenther@suse.de> Backport from mainline 2018-11-23 Richard Biener <rguenther@suse.de> PR tree-optimization/88149 * tree-vect-slp.c (vect_slp_analyze_node_operations): Detect the case where there are two different def types for the same operand at different operand position in the same stmt. * g++.dg/torture/pr88149.C: New testcase. From-SVN: r275370
2019-09-04Backport PRs 87929, 88030, 88415, 88448, 88903, 89698, 90006Richard Biener17-12/+362
2019-09-04 Richard Biener <rguenther@suse.de> Backport from mainline 2019-04-09 Richard Sandiford <richard.sandiford@arm.com> * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Always use gimple_expr_type for load and store calls. Skip over the condition argument in a conditional internal function. Protect use of TREE_INT_CST_LOW. 2019-04-08 Richard Biener <rguenther@suse.de> PR tree-optimization/90006 * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Handle calls like lrint. * gcc.dg/vect/bb-slp-pr90006.c: New testcase. 2019-03-14 Richard Biener <rguenther@suse.de> PR middle-end/89698 * fold-const.c (operand_equal_p): For INDIRECT_REF check that the access types are similar. * g++.dg/torture/pr89698.C: New testcase. 2019-01-18 Richard Biener <rguenther@suse.de> PR tree-optimization/88903 * tree-vect-stmts.c (vectorizable_shift): Verify we see all scalar stmts a SLP shift amount is composed of when detecting shifts by scalars. * gcc.dg/vect/pr88903-1.c: New testcase. * gcc.dg/vect/pr88903-2.c: Likewise. 2018-12-11 Richard Biener <rguenther@suse.de> PR middle-end/88448 PR middle-end/88415 * tree-complex.c (update_complex_assignment): Properly transfer or clean EH info around gimple_assign_set_rhs_with_ops. * gcc.dg/gomp/pr88415.c: New testcase. 2018-11-15 Richard Biener <rguenther@suse.de> PR tree-optimization/88030 * tree-complex.c (need_eh_cleanup): New global. (update_complex_assignment): Mark blocks that need EH update. (expand_complex_comparison): Likewise. (tree_lower_complex): Allocate and deallocate need_eh_cleanup, perform EH cleanup and schedule CFG cleanup if that did anything. * gcc.dg/tsan/pr88030.c: New testcase. 2018-11-08 Richard Biener <rguenther@suse.de> PR tree-optimization/87929 * tree-complex.c (expand_complex_comparison): Clean EH. * gcc.dg/pr87929.c: New testcase. 2017-07-25 Eric Botcazou <ebotcazou@adacore.com> * gimple.c (gimple_assign_set_rhs_with_ops): Do not ask gsi_replace to update EH info here. From-SVN: r275366
2019-09-04Daily bump.GCC Administrator1-1/+1
From-SVN: r275359
2019-09-03[Darwin, Objective-C] Don't prepend a sysroot for the gnu-objc headers.Iain Sandoe2-24/+24
Darwin is able to use two runtimes for objective-c; the default is its native NeXT runtime, but also it can build code using the gnu-runtime. In order to do this, we have to be able to find the gnu-runtime headers (which are installed into the compiler's tree). The process to do this was erroneously prepending the sysroot to this when a sysroot is in force. The gnu-runtime headers have never been installed in a Darwin (MacOS) SDK so we must make sure that they are found local to the compiler. 2019-09-03 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-05-18 Iain Sandoe <iain@sandoe.co.uk> * config/darwin-c.c (darwin_register_objc_includes): Do not prepend the sysroot when building gnu-runtime header search paths. From-SVN: r275350
2019-09-03[Darwin, Objective-C] Switch Objective-C meta-data sections properly.Iain Sandoe2-4/+10
We were emitting the directives to switch, but not recording the change in varasm. This means that subsequent switches might be omitted (since varasm incorrectly concludes that the wrong section is current). 2019-09-03 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-05-18 Iain Sandoe <iain@sandoe.co.uk> * config/darwin.c (darwin_file_end): Use switch_to_section () instead of direct output of the asm. From-SVN: r275349
2019-09-03[Darwin] Fix lto options.Iain Sandoe2-1/+9
These had been changed in gcc/gcc.c without being synchronised to config/darwin.h leading to some fails. 2019-09-03 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2018-08-22 Iain Sandoe <iain@sandoe.co.uk> * config/darwin.h (LINK_COMMAND_SPEC_A): Update lto options to match gcc/gcc.c. From-SVN: r275347
2019-09-03Daily bump.GCC Administrator1-1/+1
From-SVN: r275325
2019-09-02Backport PRs 89135, 89296, 89392, 89572, 89710Richard Biener12-10/+193
2019-09-02 Richard Biener <rguenther@suse.de> Backport from mainline 2019-03-14 Richard Biener <rguenther@suse.de> PR tree-optimization/89710 * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use safe_dyn_cast. * gcc.dg/torture/pr89710.c: New testcase. 2019-03-14 Richard Biener <rguenther@suse.de> PR middle-end/89572 * tree-scalar-evolution.c (get_loop_exit_condition): Use safe_dyn_cast. * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): Use gimple_location_safe. * gcc.dg/torture/pr89572.c: New testcase. 2019-02-18 Richard Biener <rguenther@suse.de> PR tree-optimization/89296 * tree-ssa-loop-ch.c (ch_base::copy_headers): Restrict setting of no-warning flag to cases that might emit the bogus warning. * gcc.dg/uninit-pr89296.c: New testcase. 2019-02-21 Richard Biener <rguenther@suse.de> PR middle-end/89392 cp/ * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not make symtab process new functions here. 2019-01-31 Richard Biener <rguenther@suse.de> PR tree-optimization/89135 * tree-ssa-phiprop.c (pass_phiprop::execute): Skip blocks with abnormal preds. * gcc.dg/torture/pr89135.c: New testcase. From-SVN: r275319
2019-09-02Backport PRs 90020, 90278, 91126, 91131, 91162, 91200Richard Biener16-4/+326
2019-09-02 Richard Biener <rguenther@suse.de> Backport from mainline 2019-07-19 Richard Biener <rguenther@suse.de> PR tree-optimization/91200 * tree-ssa-phiopt.c (cond_store_replacement): Check we have no PHI nodes in middle-bb. * gcc.dg/torture/pr91200.c: New testcase. 2019-07-15 Richard Biener <rguenther@suse.de> PR middle-end/91162 * tree-cfg.c (move_block_to_fn): When releasing a virtual PHI node make sure to replace all uses with something valid. * gcc.dg/autopar/pr91162.c: New testcase. 2019-07-11 Richard Biener <rguenther@suse.de> PR middle-end/91131 * gimplify.c (gimplify_compound_literal_expr): Force a temporary when the object is volatile and we have not cleared it even though there are no nonzero elements. * gcc.target/i386/pr91131.c: New testcase. 2019-07-10 Richard Biener <rguenther@suse.de> PR tree-optimization/91126 * tree-ssa-sccvn.c (n_walk_cb_data::push_partial_def): Adjust native encoding offset for BYTES_BIG_ENDIAN. (vn_reference_lookup_3): Likewise. * gcc.dg/torture/pr91126.c: New testcase. 2019-07-10 Richard Biener <rguenther@suse.de> PR tree-optimization/91126 * tree-ssa-sccvn.c (vn_reference_lookup_3): Adjust native encoding offset for BYTES_BIG_ENDIAN. * gcc.dg/torture/pr91126.c: New testcase. 2019-04-29 Richard Biener <rguenther@suse.de> PR tree-optimization/90278 * tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean EH on comparison simplification. * gcc.dg/torture/pr90278.c: New testcase. 2019-04-11 Richard Biener <rguenther@suse.de> PR tree-optimization/90020 * tree-ssa-sccvn.c (vn_reference_may_trap): New function. * tree-ssa-sccvn.h (vn_reference_may_trap): Declare. * tree-ssa-pre.c (compute_avail): Use it to not put possibly trapping references after a call that might not return into EXP_GEN. * gcse.c (compute_hash_table_work): Do not elide marking a block containing a call if the call might not return. * gcc.dg/torture/pr90020.c: New testcase. From-SVN: r275317
2019-09-02backport: re PR tree-optimization/91137 (Wrong code with -O3)Bin Cheng4-38/+106
Backport from mainline 2019-07-18 Bin Cheng <bin.linux@linux.alibaba.com> PR tree-optimization/91137 * tree-ssa-loop-ivopts.c (struct ivopts_data): New field. (tree_ssa_iv_optimize_init, alloc_iv, tree_ssa_iv_optimize_finalize): Init, use and fini the above new field. (determine_base_object_1): New function. (determine_base_object): Reimplement using walk_tree. 2019-07-18 Bin Cheng <bin.linux@linux.alibaba.com> PR tree-optimization/91137 * gcc.c-torture/execute/pr91137.c: New test. From-SVN: r275304
2019-09-02Daily bump.GCC Administrator1-1/+1
From-SVN: r275287
2019-09-01Daily bump.GCC Administrator1-1/+1
From-SVN: r275261
2019-08-31rs6000: Fix darn-3.c for GCC 8 and GCC 7Segher Boessenkool2-1/+7
Apparently I didn't properly test the testcase backport to GCC 8 and GCC 7. This makes it not fail there. PR target/91481 * gcc.target/powerpc/darn-3.c: Fix testcase. From-SVN: r275245
2019-08-31Daily bump.GCC Administrator1-1/+1
From-SVN: r275232
2019-08-30Backport PRs 89677, 90071, 90194, 90213, 90474, 90637, 90930Richard Biener12-7/+149
2019-08-30 Richard Biener <rguenther@suse.de> Backport from mainline 2019-05-27 Richard Biener <rguenther@suse.de> PR tree-optimization/90637 * tree-ssa-sink.c (statement_sink_location): Honor the computed sink location for single-uses. * gcc.dg/gomp/pr90637.c: New testcase. 2019-06-21 Richard Biener <rguenther@suse.de> PR tree-optimization/90930 * tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Set visited flag on new stmts to avoid re-processing them. 2019-05-15 Richard Biener <rguenther@suse.de> PR c/90474 * c-common.c (c_common_mark_addressable_vec): Also mark a COMPOUND_LITERAL_EXPR_DECL addressable similar to c_mark_addressable. 2019-04-25 Richard Biener <rguenther@suse.de> PR middle-end/90194 * match.pd: Add pattern to simplify view-conversion of an empty constructor. * g++.dg/torture/pr90194.C: New testcase. 2019-04-24 Richard Biener <rguenther@suse.de> PR middle-end/90213 * gimple-fold.c (fold_const_aggregate_ref_1): Do multiplication by size and BITS_PER_UNIT on poly-wide-ints. 2019-04-15 Richard Biener <rguenther@suse.de> PR tree-optimization/90071 * tree-ssa-reassoc.c (init_range_entry): Do not pick up abnormal operands from def stmts. * gcc.dg/torture/pr90071.c: New testcase. 2019-03-13 Richard Biener <rguenther@suse.de> PR middle-end/89677 * tree-scalar-evolution.c (simplify_peeled_chrec): Do not throw FP expressions at tree-affine. * gcc.dg/torture/pr89677.c: New testcase. From-SVN: r275208
2019-08-30backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated ↵Segher Boessenkool2-0/+24
output (CVE-2019-15847)) Backport from trunk 2019-08-23 Segher Boessenkool <segher@kernel.crashing.org> gcc/testsuite/ PR target/91481 * gcc.target/powerpc/darn-3.c: New testcase. From-SVN: r275186
2019-08-30backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated ↵Segher Boessenkool2-6/+20
output (CVE-2019-15847)) Backport from trunk 2019-08-22 Segher Boessenkool <segher@kernel.crashing.org> PR target/91481 * config/rs6000/rs6000.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32, and UNSPEC_DARN_RAW. (unspecv): New enumerator values UNSPECV_DARN, UNSPECV_DARN_32, and UNSPECV_DARN_RAW. (darn_32): Use an unspec_volatile, and UNSPECV_DARN_32. (darn_raw): Use an unspec_volatile, and UNSPECV_DARN_RAW. (darn): Use an unspec_volatile, and UNSPECV_DARN. From-SVN: r275185
2019-08-30backport: altivec.md (unspec): Delete UNSPEC_DARN...Segher Boessenkool3-220/+239
Backport from trunk 2019-08-22 Segher Boessenkool <segher@kernel.crashing.org> * config/rs6000/altivec.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32, UNSPEC_DARN_RAW, UNSPEC_CMPRB, UNSPEC_CMPRB2, UNSPEC_CMPEQB; move to... * config/rs6000/rs6000.md (unspec): ... here. * config/rs6000/altivec.md (darn_32, darn_raw, darn, cmprb, *cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal, cmpeqb, *cmpeqb_internal): Delete, move to... * config/rs6000/rs6000.md (darn_32, darn_raw, darn, cmprb, *cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal, cmpeqb, *cmpeqb_internal): ... here. From-SVN: r275184
2019-08-30backport: re PR target/91150 (wrong code with -O -mavx512vbmi due to wrong ↵Jakub Jelinek4-2/+52
writemask) Backported from mainline 2019-07-30 Jakub Jelinek <jakub@redhat.com> PR target/91150 * config/i386/i386.c (expand_vec_perm_blend): Change mask type from unsigned to unsigned HOST_WIDE_INT. For E_V64QImode cast comparison to unsigned HOST_WIDE_INT before shifting it left. * gcc.target/i386/avx512bw-pr91150.c: New test. From-SVN: r275164
2019-08-30backport: re PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP ↵Jakub Jelinek4-3/+48
SIMD region) Backported from mainline 2019-07-04 Jakub Jelinek <jakub@redhat.com> PR middle-end/78884 * gimplify.c (struct gimplify_omp_ctx): Add add_safelen1 member. (gimplify_bind_expr): If seeing TREE_ADDRESSABLE VLA inside of simd loop body, set ctx->add_safelen1 instead of making it GOVD_PRIVATE. (gimplify_adjust_omp_clauses): Add safelen (1) clause if ctx->add_safelen1 is set. * gcc.dg/gomp/pr78884.c: New test. From-SVN: r275163
2019-08-30backport: re PR rtl-optimization/90756 (g++ ICE in convert_move, at ↵Jakub Jelinek4-10/+38
expr.c:218 on i686 and s390x) Backported from mainline 2019-07-04 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/90756 * explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it for VECTOR_TYPE_P. * gcc.dg/pr90756.c: New test. From-SVN: r275162
2019-08-30backport: re PR sanitizer/90954 (ICE: combining undefined behavior sanitizer ↵Jakub Jelinek4-1/+42
with openmp) Backported from mainline 2019-06-25 Jakub Jelinek <jakub@redhat.com> PR sanitizer/90954 * c-omp.c (c_finish_omp_atomic): Allow tree_invariant_p in addition to SAVE_EXPR in first operand of a COMPOUND_EXPR. * c-c++-common/gomp/pr90954.c: New test. From-SVN: r275161
2019-08-30backport: re PR c++/90950 (OpenMP clause handling rejecting references to ↵Jakub Jelinek4-1/+29
incomplete types in templates) Backported from mainline 2019-06-21 Jakub Jelinek <jakub@redhat.com> PR c++/90950 * semantics.c (finish_omp_clauses): Don't reject references to incomplete types if processing_template_decl. * g++.dg/gomp/lastprivate-1.C: New test. From-SVN: r275160
2019-08-30backport: re PR c/90760 (ICE on attributes section and alias in set_section, ↵Jakub Jelinek4-1/+20
at symtab.c:1573) Backported from mainline 2019-06-12 Jakub Jelinek <jakub@redhat.com> PR c/90760 * symtab.c (symtab_node::set_section): Allow being called on aliases as long as they aren't analyzed yet. * gcc.dg/pr90760.c: New test. From-SVN: r275159
2019-08-30backport: re PR pch/90326 (Using any precompiled header breaks definition of ↵Jakub Jelinek7-2/+33
FLT_MAX) Backported from mainline 2019-05-10 Jakub Jelinek <jakub@redhat.com> PR pch/90326 cp/ * config-lang.in (gtfiles): Remove c-family/c-lex.c, add c-family/c-cppbuiltin.c. objcp/ * config-lang.in (gtfiles): Remove c-family/c-lex.c, add c-family/c-cppbuiltin.c. testsuite/ * g++.dg/pch/pr90326.C: New test. * g++.dg/pch/pr90326.Hs: New file. From-SVN: r275157
2019-08-30backport: re PR middle-end/90139 (ICE in emit_block_move_hints, at expr.c:1601)Jakub Jelinek4-0/+33
Backported from mainline 2019-04-19 Jakub Jelinek <jakub@redhat.com> PR middle-end/90139 * tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return assign_temp instead of gen_reg_rtx. * gcc.c-torture/compile/pr90139.c: New test. From-SVN: r275156
2019-08-30backport: re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code)Jakub Jelinek2-1/+7
Backported from mainline 2019-06-11 Jakub Jelinek <jakub@redhat.com> PR target/90811 * config/nvptx/nvptx.c (nvptx_output_softstack_switch): Use and.b%d instead of and.u%d. * testsuite/libgomp.c/pr90811.c: New test. From-SVN: r275155
2019-08-30backport: lang.opt (ftail-call-workaround=): Fix a typo - lenghts to lengths.Jakub Jelinek2-1/+5
Backported from mainline 2019-05-30 Jakub Jelinek <jakub@redhat.com> * lang.opt (ftail-call-workaround=): Fix a typo - lenghts to lengths. From-SVN: r275154
2019-08-30backport: re PR fortran/90329 (Incompatibility between gfortran and C lapack ↵Jakub Jelinek13-6/+145
calls) Backported from mainline 2019-05-29 Jakub Jelinek <jakub@redhat.com> PR fortran/90329 * lto-streamer.h (LTO_minor_version): Bump to 1. Backported from mainline 2019-05-16 Jakub Jelinek <jakub@redhat.com> PR fortran/90329 * tree-core.h (struct tree_decl_common): Document decl_nonshareable_flag for PARM_DECLs. * tree.h (DECL_HIDDEN_STRING_LENGTH): Define. * calls.c (expand_call): Don't try tail call if caller has any DECL_HIDDEN_STRING_LENGTH PARM_DECLs that are or might be passed on the stack and callee needs to pass any arguments on the stack. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use else if instead of series of mutually exclusive ifs. Handle DECL_HIDDEN_STRING_LENGTH for PARM_DECLs. * tree-streamer-out.c (pack_ts_decl_common_value_fields): Likewise. * lang.opt (fbroken-callers): Remove. (ftail-call-workaround, ftail-call-workaround=): New options. * gfortran.h (struct gfc_namespace): Add implicit_interface_calls. * interface.c (gfc_procedure_use): Set implicit_interface_calls for calls to implicit interface procedures. * trans-decl.c (create_function_arglist): Use flag_tail_call_workaround instead of flag_broken_callers. If it is not 2, also require sym->ns->implicit_interface_calls. * invoke.texi (fbroken-callers): Remove documentation. (ftail-call-workaround, ftail-call-workaround=): Document. 2019-05-19 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/90329 * invoke.texi: Document -fbroken-callers. * lang.opt: Add -fbroken-callers. * trans-decl.c (create_function_arglist): Only set DECL_HIDDEN_STRING_LENGTH if flag_broken_callers is set. 2019-05-16 Jakub Jelinek <jakub@redhat.com> PR fortran/90329 * trans-decl.c (create_function_arglist): Set DECL_HIDDEN_STRING_LENGTH on hidden string length PARM_DECLs if len is constant. From-SVN: r275153
2019-08-30backport: re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64)Jakub Jelinek4-0/+24
Backported from mainline 2019-04-24 Jakub Jelinek <jakub@redhat.com> PR target/90187 * config/i386/i386.c (ix86_expand_sse_fp_minmax): Force if_true into a register if both if_true and if_false are MEMs. * g++.dg/opt/pr90187.C: New test. From-SVN: r275152
2019-08-30backport: re PR tree-optimization/90208 (error: EH landing pad label)Jakub Jelinek4-1/+32
Backported from mainline 2019-04-24 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/90208 * tree-cfg.c (remove_bb): Move forced labels from removed bbs after labels of new_bb, not before them. * gcc.dg/tsan/pr90208-2.c: New test. From-SVN: r275151
2019-08-30backport: re PR c++/90108 (ICE: Segmentation fault (in c_tree_chain_next))Jakub Jelinek6-2/+61
Backported from mainline 2019-04-19 Jakub Jelinek <jakub@redhat.com> PR c++/90108 * c-decl.c (merge_decls): If remove is main variant and DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE variant that has newdecl as TYPE_NAME if any. * decl.c (duplicate_decls): If remove is main variant and DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE variant that has newdecl as TYPE_NAME if any. * c-c++-common/pr90108.c: New test. From-SVN: r275150
2019-08-30backport: re PR rtl-optimization/90082 (ICE in delete_unmarked_insns, at ↵Jakub Jelinek4-4/+48
dce.c:653) Backported from mainline 2019-04-16 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/90082 * dce.c (can_delete_call): New function. (deletable_insn_p, mark_insn): Use it. * gcc.dg/pr90082.c: New test. From-SVN: r275149
2019-08-30backport: re PR tree-optimization/90090 (ICE in mark_reachable_handlers, at ↵Jakub Jelinek4-1/+32
tree-eh.c:3938 since r219202) Backported from mainline 2019-04-16 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/90090 * tree-ssa-math-opts.c (is_division_by): Ignore divisions that can throw internally. * g++.dg/opt/pr90090.C: New test. From-SVN: r275148
2019-08-30backport: re PR c/89933 (ICE in merge_decls, at c/c-decl.c:2517)Jakub Jelinek6-14/+44
Backported from mainline 2019-04-12 Jakub Jelinek <jakub@redhat.com> PR c/89933 * c-decl.c (merge_decls): When newdecl's type is its main variant, don't try to remove it from the variant list, but instead assert it has no variants. * decl.c (duplicate_decls): When newdecl's type is its main variant, don't try to remove it from the variant list, but instead assert it has no variants. * c-c++-common/pr89933.c: New test. From-SVN: r275147
2019-08-30backport: re PR middle-end/89998 (ICE: verify_gimple failed in ↵Jakub Jelinek6-19/+80
printf-return-value) Backported from mainline 2019-04-09 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/89998 * gimple-ssa-sprintf.c (try_substitute_return_value): Use lhs type instead of integer_type_node if possible, don't add ranges if return type is not compatible with int. * gimple-fold.c (gimple_fold_builtin_sprintf, gimple_fold_builtin_snprintf): Use lhs type instead of hardcoded integer_type_node. * gcc.c-torture/compile/pr89998-1.c: New test. * gcc.c-torture/compile/pr89998-2.c: New test. From-SVN: r275146