Skip to content
Snippets Groups Projects
  1. Dec 13, 2022
    • Philip Herron's avatar
      gccrs: Add gcc-check-target check-rust · dc4171ed
      Philip Herron authored
      This allows us to invoke the rust testsuite.
      
      	* Makefile.def: Add Rust language.
      	* Makefile.in: Regenerate via autogen.
      dc4171ed
    • Philip Herron's avatar
      gccrs: Add execution test cases · 5a56869d
      Philip Herron authored
      
      This is similar to the compile/torture/*.rs test cases, but all of these are
      dg-execute testcases. They are compiled, linked and executed by default. These
      testcases are also compiled with the matrix of torture options.
      
      The only caveat here is that gccrs does not currently support the main shim,
      so we have a C-style main function here returning zero which is not proper Rust
      code.
      
      	gcc/testsuite/
      	* rust/execute/torture/block_expr1.rs: New.
      	* rust/execute/torture/builtin_macro_cfg.rs: New.
      	* rust/execute/torture/builtin_macro_concat.rs: New.
      	* rust/execute/torture/builtin_macro_env.rs: New.
      	* rust/execute/torture/builtin_macro_include_bytes.rs: New.
      	* rust/execute/torture/builtin_macro_include_str.rs: New.
      	* rust/execute/torture/builtin_macro_line.rs: New.
      	* rust/execute/torture/builtin_macros1.rs: New.
      	* rust/execute/torture/builtin_macros3.rs: New.
      	* rust/execute/torture/cfg1.rs: New.
      	* rust/execute/torture/cfg2.rs: New.
      	* rust/execute/torture/cfg3.rs: New.
      	* rust/execute/torture/cfg4.rs: New.
      	* rust/execute/torture/cfg5.rs: New.
      	* rust/execute/torture/coercion1.rs: New.
      	* rust/execute/torture/coercion2.rs: New.
      	* rust/execute/torture/const_fold1.rs: New.
      	* rust/execute/torture/const_fold2.rs: New.
      	* rust/execute/torture/copy_nonoverlapping1.rs: New.
      	* rust/execute/torture/empty_main.rs: New.
      	* rust/execute/torture/execute.exp: New.
      	* rust/execute/torture/exit_error.rs: New.
      	* rust/execute/torture/extern_mod4.rs: New.
      	* rust/execute/torture/func1.rs: New.
      	* rust/execute/torture/helloworld1.rs: New.
      	* rust/execute/torture/helloworld2.rs: New.
      	* rust/execute/torture/include.txt: New.
      	* rust/execute/torture/index1.rs: New.
      	* rust/execute/torture/issue-1120.rs: New.
      	* rust/execute/torture/issue-1133.rs: New.
      	* rust/execute/torture/issue-1198.rs: New.
      	* rust/execute/torture/issue-1231.rs: New.
      	* rust/execute/torture/issue-1232.rs: New.
      	* rust/execute/torture/issue-1249.rs: New.
      	* rust/execute/torture/issue-1436.rs: New.
      	* rust/execute/torture/issue-1496.rs: New.
      	* rust/execute/torture/issue-647.rs: New.
      	* rust/execute/torture/issue-845.rs: New.
      	* rust/execute/torture/issue-851.rs: New.
      	* rust/execute/torture/issue-858.rs: New.
      	* rust/execute/torture/issue-976.rs: New.
      	* rust/execute/torture/issue-995.rs: New.
      	* rust/execute/torture/macros1.rs: New.
      	* rust/execute/torture/macros10.rs: New.
      	* rust/execute/torture/macros11.rs: New.
      	* rust/execute/torture/macros12.rs: New.
      	* rust/execute/torture/macros13.rs: New.
      	* rust/execute/torture/macros14.rs: New.
      	* rust/execute/torture/macros16.rs: New.
      	* rust/execute/torture/macros17.rs: New.
      	* rust/execute/torture/macros18.rs: New.
      	* rust/execute/torture/macros19.rs: New.
      	* rust/execute/torture/macros2.rs: New.
      	* rust/execute/torture/macros20.rs: New.
      	* rust/execute/torture/macros21.rs: New.
      	* rust/execute/torture/macros22.rs: New.
      	* rust/execute/torture/macros23.rs: New.
      	* rust/execute/torture/macros24.rs: New.
      	* rust/execute/torture/macros25.rs: New.
      	* rust/execute/torture/macros26.rs: New.
      	* rust/execute/torture/macros27.rs: New.
      	* rust/execute/torture/macros28.rs: New.
      	* rust/execute/torture/macros29.rs: New.
      	* rust/execute/torture/macros3.rs: New.
      	* rust/execute/torture/macros30.rs: New.
      	* rust/execute/torture/macros31.rs: New.
      	* rust/execute/torture/macros4.rs: New.
      	* rust/execute/torture/macros5.rs: New.
      	* rust/execute/torture/macros6.rs: New.
      	* rust/execute/torture/macros7.rs: New.
      	* rust/execute/torture/macros8.rs: New.
      	* rust/execute/torture/macros9.rs: New.
      	* rust/execute/torture/match1.rs: New.
      	* rust/execute/torture/match2.rs: New.
      	* rust/execute/torture/match3.rs: New.
      	* rust/execute/torture/match_bool1.rs: New.
      	* rust/execute/torture/match_byte1.rs: New.
      	* rust/execute/torture/match_char1.rs: New.
      	* rust/execute/torture/match_int1.rs: New.
      	* rust/execute/torture/match_loop1.rs: New.
      	* rust/execute/torture/match_range1.rs: New.
      	* rust/execute/torture/match_range2.rs: New.
      	* rust/execute/torture/match_tuple1.rs: New.
      	* rust/execute/torture/method1.rs: New.
      	* rust/execute/torture/method2.rs: New.
      	* rust/execute/torture/method3.rs: New.
      	* rust/execute/torture/method4.rs: New.
      	* rust/execute/torture/mod1.rs: New.
      	* rust/execute/torture/modules/mod.rs: New.
      	* rust/execute/torture/operator_overload_1.rs: New.
      	* rust/execute/torture/operator_overload_10.rs: New.
      	* rust/execute/torture/operator_overload_11.rs: New.
      	* rust/execute/torture/operator_overload_12.rs: New.
      	* rust/execute/torture/operator_overload_2.rs: New.
      	* rust/execute/torture/operator_overload_3.rs: New.
      	* rust/execute/torture/operator_overload_4.rs: New.
      	* rust/execute/torture/operator_overload_5.rs: New.
      	* rust/execute/torture/operator_overload_6.rs: New.
      	* rust/execute/torture/operator_overload_7.rs: New.
      	* rust/execute/torture/operator_overload_8.rs: New.
      	* rust/execute/torture/operator_overload_9.rs: New.
      	* rust/execute/torture/slice-magic.rs: New.
      	* rust/execute/torture/slice-magic2.rs: New.
      	* rust/execute/torture/slice1.rs: New.
      	* rust/execute/torture/str-layout1.rs: New.
      	* rust/execute/torture/str-zero.rs: New.
      	* rust/execute/torture/trait1.rs: New.
      	* rust/execute/torture/trait10.rs: New.
      	* rust/execute/torture/trait11.rs: New.
      	* rust/execute/torture/trait12.rs: New.
      	* rust/execute/torture/trait13.rs: New.
      	* rust/execute/torture/trait2.rs: New.
      	* rust/execute/torture/trait3.rs: New.
      	* rust/execute/torture/trait4.rs: New.
      	* rust/execute/torture/trait5.rs: New.
      	* rust/execute/torture/trait6.rs: New.
      	* rust/execute/torture/trait7.rs: New.
      	* rust/execute/torture/trait8.rs: New.
      	* rust/execute/torture/trait9.rs: New.
      	* rust/execute/torture/transmute1.rs: New.
      	* rust/execute/torture/wrapping_op1.rs: New.
      	* rust/execute/torture/wrapping_op2.rs: New.
      	* rust/execute/xfail/macro1.rs: New.
      
      Co-authored-by: default avatarArthur Cohen <arthur.cohen@embecosm.com>
      Co-authored-by: default avatarThomas Schwinge <thomas@codesourcery.com>
      Co-authored-by: default avatarMark Wielaard <mark@klomp.org>
      Co-authored-by: default avatarMarc Poulhiès <dkm@kataplop.net>
      5a56869d
    • Philip Herron's avatar
      gccrs: Add general compilation test cases · 97705b44
      Philip Herron authored
      
      This suite of tests has two sections: compile/*.rs and compile/torture/*.rs.
      The first section is comprised entirely of dg-compile tests, containing a
      mixture of dg-warning and dg-error annotations and some with no annotations,
      ensuring the creation of resulting asm output. The second section is the same,
      but has tests which are ran with the full torture options, for coverage of test
      cases that may have an issue with a specific optimization level.
      
      	gcc/testsuite/
      	* rust/compile/abi-options1.rs: New.
      	* rust/compile/array3.rs: New.
      	* rust/compile/array_empty_list.rs: New.
      	* rust/compile/arrays1.rs: New.
      	* rust/compile/arrays2.rs: New.
      	* rust/compile/attr-mismatch-crate-name.rs: New.
      	* rust/compile/attr_cold.rs: New.
      	* rust/compile/attr_deprecated.rs: New.
      	* rust/compile/attr_deprecated_2.rs: New.
      	* rust/compile/bad-crate-name.rs: New.
      	* rust/compile/bad=file-name.rs: New.
      	* rust/compile/bad_as_bool_char.rs: New.
      	* rust/compile/bad_file_name.txt.rs: New.
      	* rust/compile/bad_inner_doc.rs: New.
      	* rust/compile/bad_pub_enumitems.rs: New.
      	* rust/compile/bad_stmt_enums.rs: New.
      	* rust/compile/bad_toplevel_enums.rs: New.
      	* rust/compile/bad_tuple_index.rs: New.
      	* rust/compile/bad_type1.rs: New.
      	* rust/compile/bad_type2.rs: New.
      	* rust/compile/break1.rs: New.
      	* rust/compile/break2.rs: New.
      	* rust/compile/builtin_macro_compile_error.rs: New.
      	* rust/compile/builtin_macro_concat.rs: New.
      	* rust/compile/builtin_macro_env.rs: New.
      	* rust/compile/builtin_macro_include_bytes.rs: New.
      	* rust/compile/builtin_macro_include_str.rs: New.
      	* rust/compile/builtin_macro_not_found.rs: New.
      	* rust/compile/bytecharstring.rs: New.
      	* rust/compile/canonical_paths1.rs: New.
      	* rust/compile/cast1.rs: New.
      	* rust/compile/cfg1.rs: New.
      	* rust/compile/cfg2.rs: New.
      	* rust/compile/cfg3.rs: New.
      	* rust/compile/cfg4.rs: New.
      	* rust/compile/cfg5.rs: New.
      	* rust/compile/compile.exp: New.
      	* rust/compile/complex-path1.rs: New.
      	* rust/compile/const-issue1440.rs: New.
      	* rust/compile/const1.rs: New.
      	* rust/compile/const2.rs: New.
      	* rust/compile/const3.rs: New.
      	* rust/compile/const_generics_1.rs: New.
      	* rust/compile/const_generics_2.rs: New.
      	* rust/compile/const_generics_3.rs: New.
      	* rust/compile/const_generics_4.rs: New.
      	* rust/compile/const_generics_5.rs: New.
      	* rust/compile/const_generics_6.rs: New.
      	* rust/compile/continue1.rs: New.
      	* rust/compile/deadcode_err1.rs: New.
      	* rust/compile/deadcode_err2.rs: New.
      	* rust/compile/debug-diagnostics-default.rs: New.
      	* rust/compile/debug-diagnostics-off.rs: New.
      	* rust/compile/debug-diagnostics-on.rs: New.
      	* rust/compile/doc_isolated_cr_block_comment.rs: New.
      	* rust/compile/doc_isolated_cr_inner_block_comment.rs: New.
      	* rust/compile/doc_isolated_cr_inner_line_comment.rs: New.
      	* rust/compile/doc_isolated_cr_line_comment.rs: New.
      	* rust/compile/dup_fields.rs: New.
      	* rust/compile/empty_comment_before_match.rs: New.
      	* rust/compile/expected_type_args2.rs: New.
      	* rust/compile/expected_type_args3.rs: New.
      	* rust/compile/func1.rs: New.
      	* rust/compile/func2.rs: New.
      	* rust/compile/func3.rs: New.
      	* rust/compile/func4.rs: New.
      	* rust/compile/func5.rs: New.
      	* rust/compile/generic-default1.rs: New.
      	* rust/compile/generics1.rs: New.
      	* rust/compile/generics10.rs: New.
      	* rust/compile/generics11.rs: New.
      	* rust/compile/generics12.rs: New.
      	* rust/compile/generics13.rs: New.
      	* rust/compile/generics2.rs: New.
      	* rust/compile/generics3.rs: New.
      	* rust/compile/generics4.rs: New.
      	* rust/compile/generics5.rs: New.
      	* rust/compile/generics6.rs: New.
      	* rust/compile/generics7.rs: New.
      	* rust/compile/generics8.rs: New.
      	* rust/compile/generics9.rs: New.
      	* rust/compile/implicit_returns_err1.rs: New.
      	* rust/compile/implicit_returns_err2.rs: New.
      	* rust/compile/implicit_returns_err3.rs: New.
      	* rust/compile/implicit_returns_err4.rs: New.
      	* rust/compile/infer-crate-name.rs: New.
      	* rust/compile/inline_1.rs: New.
      	* rust/compile/inline_2.rs: New.
      	* rust/compile/issue-1005.rs: New.
      	* rust/compile/issue-1019.rs: New.
      	* rust/compile/issue-1023.rs: New.
      	* rust/compile/issue-1031.rs: New.
      	* rust/compile/issue-1034.rs: New.
      	* rust/compile/issue-1089.rs: New.
      	* rust/compile/issue-1128.rs: New.
      	* rust/compile/issue-1129-1.rs: New.
      	* rust/compile/issue-1129-2.rs: New.
      	* rust/compile/issue-1130.rs: New.
      	* rust/compile/issue-1131.rs: New.
      	* rust/compile/issue-1152.rs: New.
      	* rust/compile/issue-1165.rs: New.
      	* rust/compile/issue-1173.rs: New.
      	* rust/compile/issue-1226.rs: New.
      	* rust/compile/issue-1234.rs: New.
      	* rust/compile/issue-1235.rs: New.
      	* rust/compile/issue-1237.rs: New.
      	* rust/compile/issue-1251.rs: New.
      	* rust/compile/issue-1271.rs: New.
      	* rust/compile/issue-1289.rs: New.
      	* rust/compile/issue-1323-1.rs: New.
      	* rust/compile/issue-1323-2.rs: New.
      	* rust/compile/issue-1383.rs: New.
      	* rust/compile/issue-1393.rs: New.
      	* rust/compile/issue-1447.rs: New.
      	* rust/compile/issue-407-2.rs: New.
      	* rust/compile/issue-407.rs: New.
      	* rust/compile/issue-557.rs: New.
      	* rust/compile/issue-635-1.rs: New.
      	* rust/compile/issue-635-2.rs: New.
      	* rust/compile/lookup_err1.rs: New.
      	* rust/compile/macro-issue1053-2.rs: New.
      	* rust/compile/macro-issue1053.rs: New.
      	* rust/compile/macro-issue1224.rs: New.
      	* rust/compile/macro-issue1233.rs: New.
      	* rust/compile/macro-issue1395-2.rs: New.
      	* rust/compile/macro-issue1395.rs: New.
      	* rust/compile/macro-issue1400-2.rs: New.
      	* rust/compile/macro-issue1400.rs: New.
      	* rust/compile/macro1.rs: New.
      	* rust/compile/macro10.rs: New.
      	* rust/compile/macro11.rs: New.
      	* rust/compile/macro12.rs: New.
      	* rust/compile/macro13.rs: New.
      	* rust/compile/macro14.rs: New.
      	* rust/compile/macro15.rs: New.
      	* rust/compile/macro16.rs: New.
      	* rust/compile/macro17.rs: New.
      	* rust/compile/macro18.rs: New.
      	* rust/compile/macro19.rs: New.
      	* rust/compile/macro2.rs: New.
      	* rust/compile/macro20.rs: New.
      	* rust/compile/macro21.rs: New.
      	* rust/compile/macro22.rs: New.
      	* rust/compile/macro23.rs: New.
      	* rust/compile/macro25.rs: New.
      	* rust/compile/macro26.rs: New.
      	* rust/compile/macro27.rs: New.
      	* rust/compile/macro28.rs: New.
      	* rust/compile/macro29.rs: New.
      	* rust/compile/macro3.rs: New.
      	* rust/compile/macro30.rs: New.
      	* rust/compile/macro31.rs: New.
      	* rust/compile/macro32.rs: New.
      	* rust/compile/macro33.rs: New.
      	* rust/compile/macro34.rs: New.
      	* rust/compile/macro35.rs: New.
      	* rust/compile/macro36.rs: New.
      	* rust/compile/macro37.rs: New.
      	* rust/compile/macro38.rs: New.
      	* rust/compile/macro39.rs: New.
      	* rust/compile/macro4.rs: New.
      	* rust/compile/macro40.rs: New.
      	* rust/compile/macro41.rs: New.
      	* rust/compile/macro42.rs: New.
      	* rust/compile/macro5.rs: New.
      	* rust/compile/macro6.rs: New.
      	* rust/compile/macro7.rs: New.
      	* rust/compile/macro8.rs: New.
      	* rust/compile/macro9.rs: New.
      	* rust/compile/macro_return.rs: New.
      	* rust/compile/match1.rs: New.
      	* rust/compile/match2.rs: New.
      	* rust/compile/match3.rs: New.
      	* rust/compile/match4.rs: New.
      	* rust/compile/match5.rs: New.
      	* rust/compile/match6.rs: New.
      	* rust/compile/match7.rs: New.
      	* rust/compile/method1.rs: New.
      	* rust/compile/method2.rs: New.
      	* rust/compile/mismatch-crate-name.rs: New.
      	* rust/compile/missing_middle/both_path.rs: New.
      	* rust/compile/missing_middle/explicit.not.rs: New.
      	* rust/compile/missing_middle/inner_path.rs: New.
      	* rust/compile/missing_middle/other.rs: New.
      	* rust/compile/missing_middle/outer_path.rs: New.
      	* rust/compile/missing_middle/sub/mod.rs: New.
      	* rust/compile/missing_return1.rs: New.
      	* rust/compile/mod_missing_middle.rs: New.
      	* rust/compile/never_type_err1.rs: New.
      	* rust/compile/privacy1.rs: New.
      	* rust/compile/privacy2.rs: New.
      	* rust/compile/privacy3.rs: New.
      	* rust/compile/privacy4.rs: New.
      	* rust/compile/privacy5.rs: New.
      	* rust/compile/privacy6.rs: New.
      	* rust/compile/pub_restricted_1.rs: New.
      	* rust/compile/pub_restricted_2.rs: New.
      	* rust/compile/pub_restricted_3.rs: New.
      	* rust/compile/raw_identifiers_bad_keywords.rs: New.
      	* rust/compile/raw_identifiers_underscore.rs: New.
      	* rust/compile/redef_error1.rs: New.
      	* rust/compile/redef_error2.rs: New.
      	* rust/compile/redef_error3.rs: New.
      	* rust/compile/redef_error4.rs: New.
      	* rust/compile/redef_error5.rs: New.
      	* rust/compile/redef_error6.rs: New.
      	* rust/compile/reference1.rs: New.
      	* rust/compile/self-path1.rs: New.
      	* rust/compile/self-path2.rs: New.
      	* rust/compile/shadow1.rs: New.
      	* rust/compile/specify-crate-name.rs: New.
      	* rust/compile/static_var1.rs: New.
      	* rust/compile/stmt_with_block_err1.rs: New.
      	* rust/compile/struct_align1.rs: New.
      	* rust/compile/struct_align2.rs: New.
      	* rust/compile/struct_init1.rs: New.
      	* rust/compile/struct_pack1.rs: New.
      	* rust/compile/struct_pack2.rs: New.
      	* rust/compile/syntax-only.rs: New.
      	* rust/compile/test_mod.rs: New.
      	* rust/compile/torture/all_doc_comment_line_blocks.rs: New.
      	* rust/compile/torture/all_doc_comment_line_blocks_crlf.rs: New.
      	* rust/compile/torture/arithmetic_expressions1.rs: New.
      	* rust/compile/torture/array_const_fold_1.rs: New.
      	* rust/compile/torture/array_const_fold_2.rs: New.
      	* rust/compile/torture/array_function.rs: New.
      	* rust/compile/torture/array_type_infer.rs: New.
      	* rust/compile/torture/array_zero_length.rs: New.
      	* rust/compile/torture/arrays1.rs: New.
      	* rust/compile/torture/arrays2.rs: New.
      	* rust/compile/torture/arrays3.rs: New.
      	* rust/compile/torture/arrays4.rs: New.
      	* rust/compile/torture/arrays5.rs: New.
      	* rust/compile/torture/arrays6.rs: New.
      	* rust/compile/torture/arrays_index1.rs: New.
      	* rust/compile/torture/arrays_index2.rs: New.
      	* rust/compile/torture/arrays_index3.rs: New.
      	* rust/compile/torture/as_bool_char.rs: New.
      	* rust/compile/torture/associated_types1.rs: New.
      	* rust/compile/torture/autoderef1.rs: New.
      	* rust/compile/torture/block_expr1.rs: New.
      	* rust/compile/torture/block_expr2.rs: New.
      	* rust/compile/torture/block_expr3.rs: New.
      	* rust/compile/torture/block_expr4.rs: New.
      	* rust/compile/torture/block_expr5.rs: New.
      	* rust/compile/torture/block_expr_parser_bug.rs: New.
      	* rust/compile/torture/bom.rs: New.
      	* rust/compile/torture/bom_comment.rs: New.
      	* rust/compile/torture/bom_shebang.rs: New.
      	* rust/compile/torture/bom_whitespace.rs: New.
      	* rust/compile/torture/bools_eq.rs: New.
      	* rust/compile/torture/borrow1.rs: New.
      	* rust/compile/torture/borrow_function.rs: New.
      	* rust/compile/torture/break_function.rs: New.
      	* rust/compile/torture/byte_char_str.rs: New.
      	* rust/compile/torture/byte_str.rs: New.
      	* rust/compile/torture/cast1.rs: New.
      	* rust/compile/torture/cast2.rs: New.
      	* rust/compile/torture/cast3.rs: New.
      	* rust/compile/torture/cfg_attr.rs: New.
      	* rust/compile/torture/char1.rs: New.
      	* rust/compile/torture/check-doc-attr-string.rs: New.
      	* rust/compile/torture/coercion1.rs: New.
      	* rust/compile/torture/coercion2.rs: New.
      	* rust/compile/torture/comparison_expr1.rs: New.
      	* rust/compile/torture/compile.exp: New.
      	* rust/compile/torture/compound_assignment_expr1.rs: New.
      	* rust/compile/torture/conditional.rs: New.
      	* rust/compile/torture/constant1.rs: New.
      	* rust/compile/torture/constant2.rs: New.
      	* rust/compile/torture/constant3.rs: New.
      	* rust/compile/torture/deadcode1.rs: New.
      	* rust/compile/torture/deadcode2.rs: New.
      	* rust/compile/torture/deref1.rs: New.
      	* rust/compile/torture/deref_function.rs: New.
      	* rust/compile/torture/doc_comment.rs: New.
      	* rust/compile/torture/enum1.rs: New.
      	* rust/compile/torture/extern_mod1.rs: New.
      	* rust/compile/torture/extern_mod2.rs: New.
      	* rust/compile/torture/float1.rs: New.
      	* rust/compile/torture/float_types.rs: New.
      	* rust/compile/torture/forward_decl_1.rs: New.
      	* rust/compile/torture/forward_decl_2.rs: New.
      	* rust/compile/torture/forward_decl_3-unsafe.rs: New.
      	* rust/compile/torture/forward_decl_3.rs: New.
      	* rust/compile/torture/forward_decl_4.rs: New.
      	* rust/compile/torture/forward_decl_5.rs: New.
      	* rust/compile/torture/func1.rs: New.
      	* rust/compile/torture/func2.rs: New.
      	* rust/compile/torture/function_reference1.rs: New.
      	* rust/compile/torture/function_reference2.rs: New.
      	* rust/compile/torture/function_reference3.rs: New.
      	* rust/compile/torture/function_reference4.rs: New.
      	* rust/compile/torture/generics1.rs: New.
      	* rust/compile/torture/generics10.rs: New.
      	* rust/compile/torture/generics11.rs: New.
      	* rust/compile/torture/generics12.rs: New.
      	* rust/compile/torture/generics13.rs: New.
      	* rust/compile/torture/generics14.rs: New.
      	* rust/compile/torture/generics15.rs: New.
      	* rust/compile/torture/generics16.rs: New.
      	* rust/compile/torture/generics17.rs: New.
      	* rust/compile/torture/generics18.rs: New.
      	* rust/compile/torture/generics19.rs: New.
      	* rust/compile/torture/generics2.rs: New.
      	* rust/compile/torture/generics20.rs: New.
      	* rust/compile/torture/generics21.rs: New.
      	* rust/compile/torture/generics22.rs: New.
      	* rust/compile/torture/generics23.rs: New.
      	* rust/compile/torture/generics24.rs: New.
      	* rust/compile/torture/generics25.rs: New.
      	* rust/compile/torture/generics26.rs: New.
      	* rust/compile/torture/generics27.rs: New.
      	* rust/compile/torture/generics28.rs: New.
      	* rust/compile/torture/generics29.rs: New.
      	* rust/compile/torture/generics3.rs: New.
      	* rust/compile/torture/generics30.rs: New.
      	* rust/compile/torture/generics31.rs: New.
      	* rust/compile/torture/generics32.rs: New.
      	* rust/compile/torture/generics4.rs: New.
      	* rust/compile/torture/generics5.rs: New.
      	* rust/compile/torture/generics6.rs: New.
      	* rust/compile/torture/generics7.rs: New.
      	* rust/compile/torture/generics8.rs: New.
      	* rust/compile/torture/generics9.rs: New.
      	* rust/compile/torture/grouped_expr_function.rs: New.
      	* rust/compile/torture/identifier-missing-impl-1.rs: New.
      	* rust/compile/torture/if.rs: New.
      	* rust/compile/torture/if_elif.rs: New.
      	* rust/compile/torture/if_elif_else_expr1.rs: New.
      	* rust/compile/torture/if_else.rs: New.
      	* rust/compile/torture/ifunaryexpr.rs: New.
      	* rust/compile/torture/impl_block1.rs: New.
      	* rust/compile/torture/impl_block2.rs: New.
      	* rust/compile/torture/impl_block3.rs: New.
      	* rust/compile/torture/impl_block_unused.rs: New.
      	* rust/compile/torture/implicit_returns1.rs: New.
      	* rust/compile/torture/infer_type1.rs: New.
      	* rust/compile/torture/inner_attributes.rs: New.
      	* rust/compile/torture/integer_inference_var1.rs: New.
      	* rust/compile/torture/integer_inference_var2.rs: New.
      	* rust/compile/torture/integer_inference_var3.rs: New.
      	* rust/compile/torture/integer_inference_var4.rs: New.
      	* rust/compile/torture/integer_inference_var5.rs: New.
      	* rust/compile/torture/integer_types.rs: New.
      	* rust/compile/torture/intrinsics-1.rs: New.
      	* rust/compile/torture/intrinsics-2.rs: New.
      	* rust/compile/torture/isolated_cr_block_comment.rs: New.
      	* rust/compile/torture/isolated_cr_line_comment.rs: New.
      	* rust/compile/torture/issue-1024.rs: New.
      	* rust/compile/torture/issue-1075.rs: New.
      	* rust/compile/torture/issue-1432.rs: New.
      	* rust/compile/torture/issue-1434.rs: New.
      	* rust/compile/torture/issue-368.rs: New.
      	* rust/compile/torture/issue-808.rs: New.
      	* rust/compile/torture/issue-862.rs: New.
      	* rust/compile/torture/issue-893-2.rs: New.
      	* rust/compile/torture/issue-893.rs: New.
      	* rust/compile/torture/lazybooleanexpr_function.rs: New.
      	* rust/compile/torture/lifetime1.rs: New.
      	* rust/compile/torture/literals1.rs: New.
      	* rust/compile/torture/loop1.rs: New.
      	* rust/compile/torture/loop2.rs: New.
      	* rust/compile/torture/loop3.rs: New.
      	* rust/compile/torture/loop4.rs: New.
      	* rust/compile/torture/loop5.rs: New.
      	* rust/compile/torture/loop6.rs: New.
      	* rust/compile/torture/loop7.rs: New.
      	* rust/compile/torture/macro-issue1403.rs: New.
      	* rust/compile/torture/macro-issue1426.rs: New.
      	* rust/compile/torture/macro_as_expr.rs: New.
      	* rust/compile/torture/match1.rs: New.
      	* rust/compile/torture/methods1.rs: New.
      	* rust/compile/torture/methods2.rs: New.
      	* rust/compile/torture/methods3.rs: New.
      	* rust/compile/torture/mod-nameresolve.rs: New.
      	* rust/compile/torture/mod1.rs: New.
      	* rust/compile/torture/mod2.rs: New.
      	* rust/compile/torture/mod3.rs: New.
      	* rust/compile/torture/modules/mod.rs: New.
      	* rust/compile/torture/modules/valid_path.rs: New.
      	* rust/compile/torture/must_use1.rs: New.
      	* rust/compile/torture/must_use2.rs: New.
      	* rust/compile/torture/name_resolve1.rs: New.
      	* rust/compile/torture/negation_function.rs: New.
      	* rust/compile/torture/nested_fn1.rs: New.
      	* rust/compile/torture/nested_fn2.rs: New.
      	* rust/compile/torture/nested_struct1.rs: New.
      	* rust/compile/torture/never_type1.rs: New.
      	* rust/compile/torture/not_shebang.rs: New.
      	* rust/compile/torture/not_shebang_block_comment.rs: New.
      	* rust/compile/torture/not_shebang_comment.rs: New.
      	* rust/compile/torture/not_shebang_multiline_comment.rs: New.
      	* rust/compile/torture/not_shebang_spaces.rs: New.
      	* rust/compile/torture/parameter_usage1.rs: New.
      	* rust/compile/torture/parens1.rs: New.
      	* rust/compile/torture/pointer1.rs: New.
      	* rust/compile/torture/primconsts.rs: New.
      	* rust/compile/torture/prims_struct_eq.rs: New.
      	* rust/compile/torture/range-lang-item1.rs: New.
      	* rust/compile/torture/raw_identifiers.rs: New.
      	* rust/compile/torture/raw_identifiers_keywords.rs: New.
      	* rust/compile/torture/recursive_fn1.rs: New.
      	* rust/compile/torture/return_function.rs: New.
      	* rust/compile/torture/scoping1.rs: New.
      	* rust/compile/torture/self_type1.rs: New.
      	* rust/compile/torture/shadow1.rs: New.
      	* rust/compile/torture/shadow2.rs: New.
      	* rust/compile/torture/shebang.rs: New.
      	* rust/compile/torture/shebang_plus_attr.rs: New.
      	* rust/compile/torture/shebang_plus_attr2.rs: New.
      	* rust/compile/torture/static_function.rs: New.
      	* rust/compile/torture/static_var1.rs: New.
      	* rust/compile/torture/stmt_with_block1.rs: New.
      	* rust/compile/torture/str1.rs: New.
      	* rust/compile/torture/struct_access1.rs: New.
      	* rust/compile/torture/struct_base_init_1.rs: New.
      	* rust/compile/torture/struct_decl.rs: New.
      	* rust/compile/torture/struct_init.rs: New.
      	* rust/compile/torture/struct_init_10.rs: New.
      	* rust/compile/torture/struct_init_11.rs: New.
      	* rust/compile/torture/struct_init_2.rs: New.
      	* rust/compile/torture/struct_init_3.rs: New.
      	* rust/compile/torture/struct_init_4.rs: New.
      	* rust/compile/torture/struct_init_5.rs: New.
      	* rust/compile/torture/struct_init_6.rs: New.
      	* rust/compile/torture/struct_init_7.rs: New.
      	* rust/compile/torture/struct_init_8.rs: New.
      	* rust/compile/torture/struct_init_9.rs: New.
      	* rust/compile/torture/top_attr.rs: New.
      	* rust/compile/torture/traits1.rs: New.
      	* rust/compile/torture/traits10.rs: New.
      	* rust/compile/torture/traits11.rs: New.
      	* rust/compile/torture/traits12.rs: New.
      	* rust/compile/torture/traits13.rs: New.
      	* rust/compile/torture/traits14.rs: New.
      	* rust/compile/torture/traits15.rs: New.
      	* rust/compile/torture/traits16.rs: New.
      	* rust/compile/torture/traits17.rs: New.
      	* rust/compile/torture/traits18.rs: New.
      	* rust/compile/torture/traits19.rs: New.
      	* rust/compile/torture/traits2.rs: New.
      	* rust/compile/torture/traits3.rs: New.
      	* rust/compile/torture/traits4.rs: New.
      	* rust/compile/torture/traits5.rs: New.
      	* rust/compile/torture/traits6.rs: New.
      	* rust/compile/torture/traits7.rs: New.
      	* rust/compile/torture/traits8.rs: New.
      	* rust/compile/torture/traits9.rs: New.
      	* rust/compile/torture/transmute-size-check-1.rs: New.
      	* rust/compile/torture/transmute1.rs: New.
      	* rust/compile/torture/tuple1.rs: New.
      	* rust/compile/torture/tuple2.rs: New.
      	* rust/compile/torture/tuple3.rs: New.
      	* rust/compile/torture/tuple_enum_variants.rs: New.
      	* rust/compile/torture/tuple_field_access.rs: New.
      	* rust/compile/torture/tuple_function.rs: New.
      	* rust/compile/torture/tuple_index.rs: New.
      	* rust/compile/torture/tuple_struct1.rs: New.
      	* rust/compile/torture/tuple_struct2.rs: New.
      	* rust/compile/torture/tuple_struct_unit.rs: New.
      	* rust/compile/torture/tuple_struct_unused.rs: New.
      	* rust/compile/torture/type-alias1.rs: New.
      	* rust/compile/torture/type-alias2.rs: New.
      	* rust/compile/torture/type_infer1.rs: New.
      	* rust/compile/torture/type_infer2.rs: New.
      	* rust/compile/torture/type_infer3.rs: New.
      	* rust/compile/torture/type_infer4.rs: New.
      	* rust/compile/torture/type_infer5.rs: New.
      	* rust/compile/torture/type_infer6.rs: New.
      	* rust/compile/torture/unary_operators.rs: New.
      	* rust/compile/torture/undended-string-1.rs: New.
      	* rust/compile/torture/undended-string-2.rs: New.
      	* rust/compile/torture/underscore_id.rs: New.
      	* rust/compile/torture/union.rs: New.
      	* rust/compile/torture/union_union.rs: New.
      	* rust/compile/torture/unit_type1.rs: New.
      	* rust/compile/torture/unit_type2.rs: New.
      	* rust/compile/torture/unit_type3.rs: New.
      	* rust/compile/torture/unit_type4.rs: New.
      	* rust/compile/torture/unit_type5.rs: New.
      	* rust/compile/torture/unsafe1.rs: New.
      	* rust/compile/torture/unsafe2.rs: New.
      	* rust/compile/torture/unsafe3.rs: New.
      	* rust/compile/torture/unsafe4.rs: New.
      	* rust/compile/torture/unused.rs: New.
      	* rust/compile/torture/unused1.rs: New.
      	* rust/compile/torture/unused_struct.rs: New.
      	* rust/compile/torture/unused_struct_field.rs: New.
      	* rust/compile/torture/usize1.rs: New.
      	* rust/compile/torture/very-broken-attr-string.rs: New.
      	* rust/compile/torture/while_function.rs: New.
      	* rust/compile/traits1.rs: New.
      	* rust/compile/traits10.rs: New.
      	* rust/compile/traits11.rs: New.
      	* rust/compile/traits12.rs: New.
      	* rust/compile/traits2.rs: New.
      	* rust/compile/traits3.rs: New.
      	* rust/compile/traits4.rs: New.
      	* rust/compile/traits5.rs: New.
      	* rust/compile/traits6.rs: New.
      	* rust/compile/traits7.rs: New.
      	* rust/compile/traits8.rs: New.
      	* rust/compile/traits9.rs: New.
      	* rust/compile/tuple1.rs: New.
      	* rust/compile/tuple_struct1.rs: New.
      	* rust/compile/tuple_struct2.rs: New.
      	* rust/compile/tuple_struct3.rs: New.
      	* rust/compile/type-alias1.rs: New.
      	* rust/compile/type-bindings1.rs: New.
      	* rust/compile/unary_negation.rs: New.
      	* rust/compile/unary_not.rs: New.
      	* rust/compile/unconstrained_type_param.rs: New.
      	* rust/compile/unicode_escape.rs: New.
      	* rust/compile/unsafe1.rs: New.
      	* rust/compile/unsafe10.rs: New.
      	* rust/compile/unsafe2.rs: New.
      	* rust/compile/unsafe3.rs: New.
      	* rust/compile/unsafe4.rs: New.
      	* rust/compile/unsafe5.rs: New.
      	* rust/compile/unsafe6.rs: New.
      	* rust/compile/unsafe7.rs: New.
      	* rust/compile/unsafe8.rs: New.
      	* rust/compile/unsafe9.rs: New.
      	* rust/compile/unterminated_c_comment.rs: New.
      	* rust/compile/use_1.rs: New.
      	* rust/compile/usize1.rs: New.
      	* rust/compile/xfail/lifetime_param.rs: New.
      	* rust/compile/xfail/struct_field_vis.rs: New.
      	* rust/compile/xfail/xfail.exp: New.
      
      Co-authored-by: default avatarArthur Cohen <arthur.cohen@embecosm.com>
      Co-authored-by: default avatarThomas Schwinge <thomas@codesourcery.com>
      Co-authored-by: default avatarMark Wielaard <mark@klomp.org>
      Co-authored-by: default avatarMarc Poulhiès <dkm@kataplop.net>
      97705b44
    • Philip Herron's avatar
      gccrs: Add link cases testsuite · f60df7e6
      Philip Herron authored
      This testsuite is heavily inspired from the LTO testsuite that uses a
      pattern where each file is compiled to an object file and finally linked
      together. Since Rust does not have headers/prototypes, we rely on the
      ordering here so that all files numbered greater than zero get compiled to
      object files first. This leaves the _0 file free to test the 'extern crate' and
      'use' keywords to force testing of the compiler to read metadata from the
      other 'crates'.
      
      	gcc/testsuite/
      	* rust/link/generic_function_0.rs: New.
      	* rust/link/generic_function_1.rs: New.
      	* rust/link/link.exp: New.
      	* rust/link/simple_function_0.rs: New.
      	* rust/link/simple_function_1.rs: New.
      	* rust/link/trait_import_0.rs: New.
      	* rust/link/trait_import_1.rs: New.
      f60df7e6
    • Philip Herron's avatar
      gccrs: Add Debug info testsuite · 4b8f3005
      Philip Herron authored
      
      This testsuite is specifically about testcases which scan the asm debug
      info for results.
      
      	gcc/testsuite/
      	* rust/debug/chartype.rs: New.
      	* rust/debug/custom_link_section.rs: New.
      	* rust/debug/debug.exp: New.
      	* rust/debug/i8u8.rs: New.
      	* rust/debug/lang.rs: New.
      	* rust/debug/no_mangle.rs: New.
      	* rust/debug/oldlang.rs: New.
      	* rust/debug/tuple.rs: New.
      	* rust/debug/win64-abi.rs: New.
      
      Co-authored-by: default avatarTom Tromey <tom@tromey.com>
      Co-authored-by: default avatarMark Wielaard <mark@klomp.org>
      Co-authored-by: default avatarMarc Poulhiès <dkm@kataplop.net>
      4b8f3005
    • Philip Herron's avatar
      gccrs: Add necessary hooks for a Rust front-end testsuite · b772a504
      Philip Herron authored
      
      This copies over code from other front-end testsuites to enable testing
      for the rust front-end specifically.
      
      	gcc/testsuite/
      	* lib/rust-dg.exp: New.
      	* lib/rust.exp: New.
      
      Co-authored-by: default avatarMarc Poulhiès <dkm@kataplop.net>
      Co-authored-by: default avatarThomas Schwinge <thomas@codesourcery.com>
      b772a504
    • Tom Tromey's avatar
      Use DW_ATE_UTF for the Rust 'char' type · dd950cbb
      Tom Tromey authored
      
      The Rust 'char' type should use the DWARF DW_ATE_UTF encoding.
      
      	gcc/
      	* dwarf2out.cc (is_rust): New.
      	(base_type_die): Use DW_ATE_UTF for the Rust 'char' type.
      	(gen_compile_unit_die): Handle "GNU Rust".
      
      Co-authored-by: default avatarMark Wielaard <mark@klomp.org>
      Co-authored-by: default avatarMarc Poulhiès <dkm@kataplop.net>
      dd950cbb
    • Richard Biener's avatar
      tree-optimization/108076 - if-conversion and forced labels · b4fddbe9
      Richard Biener authored
      When doing if-conversion we simply throw away labels without checking
      whether they are possibly targets of non-local gotos or have their
      address taken.  The following rectifies this and refuses to if-convert
      such loops.
      
      	PR tree-optimization/108076
      	* tree-if-conv.cc (if_convertible_loop_p_1): Reject blocks
      	with non-local or forced labels that we later remove
      	labels from.
      
      	* gcc.dg/torture/pr108076.c: New testcase.
      b4fddbe9
    • Jakub Jelinek's avatar
      libsanitizer: Fix up libbacktrace build after r13-4547 [PR108072] · 0a43f7b1
      Jakub Jelinek authored
      The r13-4547 commit added new non-static function to libbacktrace:
      backtrace_uncompress_zstd but for the libsanitizer use we need to
      rename it, so that it is in __asan_* namespace and doesn't clash
      with other copies of libbacktrace.
      
      2022-12-13  Jakub Jelinek  <jakub@redhat.com>
      
      libsanitizer/
      	PR sanitizer/108072
      	* libbacktrace/backtrace-rename.h (backtrace_uncompress_zstd): Define.
      0a43f7b1
    • Haochen Gui's avatar
      rs6000: enable cbranchcc4 · 8ad0a7df
      Haochen Gui authored
      This patch enables "have_cbranchcc4" on rs6000 by defining a
      "cbranchcc4" expander. "have_cbrnachcc4" is a flag in ifcvt.cc to
      indicate if branching by CC bits is valid or not. With this flag
      enabled, some branches can be optimized to conditional moves.
      
      2022-12-07  Haochen Gui <guihaoc@linux.ibm.com>
      
      gcc/
      	* config/rs6000/rs6000.md (cbranchcc4): New expander.
      
      gcc/testsuite
      	* gcc.target/powerpc/cbranchcc4-1.c: New.
      	* gcc.target/powerpc/cbranchcc4-2.c: New.
      8ad0a7df
    • Haochen Gui's avatar
      optabs: make prepare_cmp_insn goto fail when cbranchcc4 checks unsatisfied · 99cce60d
      Haochen Gui authored
      prepare_cmp_insn is a help function to generate comparison rtx.
      It should not assume that cbranchcc4 exists and all sub-CC modes
      are supported on a target.  When the check fails, it could go to
      fail and return a NULL rtx as its callers check the return value
      for CCmode.
      
      The test case (gcc.target/powerpc/cbranchcc4-1.c) which covers
      failure path will be committed with an rs6000 specific patch.
      
      2022-12-05  Haochen Gui <guihaoc@linux.ibm.com>
      
      gcc/
      	* optabs.cc (prepare_cmp_insn): Return a NULL rtx other than
      	assertion failure when targets don't have cbranch optab or
      	predicate check fails.
      99cce60d
    • GCC Administrator's avatar
      Daily bump. · 1728c537
      GCC Administrator authored
      1728c537
  2. Dec 12, 2022
    • Jason Merrill's avatar
      Revert "c++: build initializer_list<string> in a loop [PR105838]" · 77ebee2b
      Jason Merrill authored
      This patch broke a couple of different patterns; reverting while I work on a
      fix.
      
      	PR c++/108701
      
      This reverts commit bd0485f2.
      77ebee2b
    • Ian Lance Taylor's avatar
      libgo: bump major version · 11c72cd3
      Ian Lance Taylor authored
      PR go/108057
      
      The current version is the same as for the previous GCC release,
      but there have been minor changes like new type descriptors that
      make it impossible to run Go programs built with the previous GCC
      release with the current libgo.
      
      Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/456976
      11c72cd3
    • Harald Anlauf's avatar
      Fortran: improve checking of assumed-size array spec [PR102180] · cf5327b8
      Harald Anlauf authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/102180
      	* array.cc (match_array_element_spec): Add check for bad
      	assumed-implied-spec.
      	(gfc_match_array_spec): Reorder logic so that the first bad array
      	element spec may trigger an error.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/102180
      	* gfortran.dg/pr102180.f90: New test.
      cf5327b8
    • Iain Buclaw's avatar
      d: Fix undefined reference to nested lambda in template (PR108055) · 9fe7d3de
      Iain Buclaw authored
      Sometimes, nested lambdas of templated functions get no code generation
      due to them being marked as instantianted outside of all modules being
      compiled in the current compilation unit.  This despite enclosing
      template instances being marked as instantiated inside the current
      compilation unit.  To fix, all enclosing templates are now checked in
      `function_defined_in_root_p'.
      
      Because of this change, `function_needs_inline_definition_p' has also
      been fixed up to only check whether the regular function definition
      itself is to be emitted in the current compilation unit.
      
      	PR d/108055
      
      gcc/d/ChangeLog:
      
      	* decl.cc (function_defined_in_root_p): Check all enclosing template
      	instances for definition in a root module.
      	(function_needs_inline_definition_p): Replace call to
      	function_defined_in_root_p with test for outer module `isRoot'.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/torture/imports/pr108055conv.d: New.
      	* gdc.dg/torture/imports/pr108055spec.d: New.
      	* gdc.dg/torture/imports/pr108055write.d: New.
      	* gdc.dg/torture/pr108055.d: New test.
      9fe7d3de
    • Wilco Dijkstra's avatar
      AArch64: Enable TARGET_CONST_ANCHOR · 2d7c73ee
      Wilco Dijkstra authored
      Enable TARGET_CONST_ANCHOR to allow complex constants to be created via
      immediate add/sub.  Use a 24-bit range as that enables a 3 or 4-instruction
      immediate to be replaced by 2 add/sub instructions.  Fix the costing of
      add/sub to support 24-bit and 12-bit shifted immediates.
      The generated code for the testcase is now the same or better than LLVM.
      It also results in a small codesize reduction on SPEC.
      
      gcc/
      	* config/aarch64/aarch64.cc (aarch64_rtx_costs): Add correct costs
      	for 24-bit and 12-bit shifted immediate add/sub.
      	(TARGET_CONST_ANCHOR): Define.
      	* config/aarch64/predicates.md (aarch64_pluslong_immediate):
      	Fix range check.
      
      gcc/testsuite/
      	* gcc.target/aarch64/movk_3.c: New test.
      2d7c73ee
    • Tamar Christina's avatar
      middle-end: simplify complex if expressions where comparisons are inverse of one another. · 4d9db4bd
      Tamar Christina authored
      This optimizes the following sequence
      
        ((a < b) & c) | ((a >= b) & d)
      
      into
      
        (a < b ? c : d) & 1
      
      for scalar and on vector we can omit the & 1.
      
      Also recognizes
      
        (-(a < b) & c) | (-(a >= b) & d)
      
      into
      
        a < b ? c : d
      
      This changes the code generation from
      
      zoo2:
      	cmp     w0, w1
      	cset    w0, lt
      	cset    w1, ge
      	and     w0, w0, w2
      	and     w1, w1, w3
      	orr     w0, w0, w1
      	ret
      
      into
      
      	cmp	w0, w1
      	csel	w0, w2, w3, lt
      	and	w0, w0, 1
      	ret
      
      and significantly reduces the number of selects we have to do in the vector
      code.
      
      gcc/ChangeLog:
      
      	* match.pd: Add new rule.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/aarch64/if-compare_1.c: New test.
      	* gcc.target/aarch64/if-compare_2.c: New test.
      4d9db4bd
    • Tamar Christina's avatar
      AArch64: Fix vector re-interpretation between partial SIMD modes · 594264e9
      Tamar Christina authored
      While writing a patch series I started getting incorrect codegen out from
      VEC_PERM on partial struct types.
      
      It turns out that this was happening because the TARGET_CAN_CHANGE_MODE_CLASS
      implementation has a slight bug in it.  The hook only checked for SIMD to
      Partial but never Partial to SIMD.   This resulted in incorrect subregs to be
      generated from the fallback code in VEC_PERM_EXPR expansions.
      
      I have unfortunately not been able to trigger it using a standalone testcase as
      the mid-end optimizes away the permute every time I try to describe a permute
      that would result in the bug.
      
      The patch now rejects any conversion of partial SIMD struct types, unless they
      are both partial structures of the same number of registers or one is a SIMD
      type who's size is less than 8 bytes.
      
      gcc/ChangeLog:
      
      	* config/aarch64/aarch64.cc (aarch64_can_change_mode_class): Restrict
      	conversions between partial struct types properly.
      594264e9
    • Tamar Christina's avatar
      AArch64: Support new tbranch optab. · 17ae956c
      Tamar Christina authored
      This implements the new tbranch optab for AArch64.
      
      we cannot emit one big RTL for the final instruction immediately.
      The reason that all comparisons in the AArch64 backend expand to separate CC
      compares, and separate testing of the operands is for ifcvt.
      
      The separate CC compare is needed so ifcvt can produce csel, cset etc from the
      compares.  Unlike say combine, ifcvt can not do recog on a parallel with a
      clobber.  Should we emit the instruction directly then ifcvt will not be able
      to say, make a csel, because we have no patterns which handle zero_extract and
      compare. (unlike combine ifcvt cannot transform the extract into an AND).
      
      While you could provide various patterns for this (and I did try) you end up
      with broken patterns because you can't add the clobber to the CC register.  If
      you do, ifcvt recog fails.
      
      i.e.
      
      int
      f1 (int x)
      {
        if (x & 1)
          return 1;
        return x;
      }
      
      We lose csel here.
      
      Secondly the reason the compare with an explicit CC mode is needed is so that
      ifcvt can transform the operation into a version that doesn't require the flags
      to be set.  But it only does so if it know the explicit usage of the CC reg.
      
      For instance
      
      int
      foo (int a, int b)
      {
        return ((a & (1 << 25)) ? 5 : 4);
      }
      
      Doesn't require a comparison, the optimal form is:
      
      foo(int, int):
              ubfx    x0, x0, 25, 1
              add     w0, w0, 4
              ret
      
      and no compare is actually needed.  If you represent the instruction using an
      ANDS instead of a zero_extract then you get close, but you end up with an ands
      followed by an add, which is a slower operation.
      
      gcc/ChangeLog:
      
      	* config/aarch64/aarch64.md (*tb<optab><mode>1): Rename to...
      	(*tb<optab><ALLI:mode><GPI:mode>1): ... this.
      	(tbranch_<code><mode>4): New.
      	* config/aarch64/iterators.md(ZEROM, zerom): New.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/aarch64/tbz_1.c: New test.
      17ae956c
    • Tamar Christina's avatar
      middle-end: Add new tbranch optab to add support for bit-test-and-branch operations · dc582d2e
      Tamar Christina authored
      This adds a new test-and-branch optab that can be used to do a conditional test
      of a bit and branch.   This is similar to the cbranch optab but instead can
      test any arbitrary bit inside the register.
      
      This patch recognizes boolean comparisons and single bit mask tests.
      
      gcc/ChangeLog:
      
      	* dojump.cc (do_jump): Pass along value.
      	(do_jump_by_parts_greater_rtx): Likewise.
      	(do_jump_by_parts_zero_rtx): Likewise.
      	(do_jump_by_parts_equality_rtx): Likewise.
      	(do_compare_rtx_and_jump): Likewise.
      	(do_compare_and_jump): Likewise.
      	* dojump.h (do_compare_rtx_and_jump): New.
      	* optabs.cc (emit_cmp_and_jump_insn_1): Refactor to take optab to check.
      	(validate_test_and_branch): New.
      	(emit_cmp_and_jump_insns): Optiobally take a value, and when value is
      	supplied then check if it's suitable for tbranch.
      	* optabs.def (tbranch_eq$a4, tbranch_ne$a4): New.
      	* doc/md.texi (tbranch_@var{op}@var{mode}4): Document it.
      	* optabs.h (emit_cmp_and_jump_insns): New.
      	* tree.h (tree_zero_one_valued_p): New.
      dc582d2e
    • Tamar Christina's avatar
      aarch64: Make existing V2HF be usable. · 2cba118e
      Tamar Christina authored
      The backend has an existing V2HFmode that is used by pairwise operations.
      This mode was however never made fully functional.  Amongst other things it was
      never declared as a vector type which made it unusable from the mid-end.
      
      It's also lacking an implementation for load/stores so reload ICEs if this mode
      is every used.  This finishes the implementation by providing the above.
      
      Note that I have created a new iterator VHSDF_P instead of extending VHSDF
      because the previous iterator is used in far more things than just load/stores.
      
      It's also used for instance in intrinsics and extending this would force me to
      provide support for mangling the type while we never expose it through
      intrinsics.
      
      gcc/ChangeLog:
      
      	* config/aarch64/aarch64-simd.md (*aarch64_simd_movv2hf): New.
      	(mov<mode>, movmisalign<mode>, aarch64_dup_lane<mode>,
      	aarch64_store_lane0<mode>, aarch64_simd_vec_set<mode>,
      	@aarch64_simd_vec_copy_lane<mode>, vec_set<mode>,
      	reduc_<optab>_scal_<mode>, reduc_<fmaxmin>_scal_<mode>,
      	aarch64_reduc_<optab>_internal<mode>, aarch64_get_lane<mode>,
      	vec_init<mode><Vel>, vec_extract<mode><Vel>): Support V2HF.
      	(aarch64_simd_dupv2hf): New.
      	* config/aarch64/aarch64.cc (aarch64_classify_vector_mode):
      	Add E_V2HFmode.
      	* config/aarch64/iterators.md (VHSDF_P): New.
      	(V2F, VMOVE, nunits, Vtype, Vmtype, Vetype, stype, VEL,
      	Vel, q, vp): Add V2HF.
      	* config/arm/types.md (neon_fp_reduc_add_h): New.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/aarch64/sve/slp_1.c: Update testcase.
      2cba118e
    • Jonathan Wakely's avatar
      libstdc++: Add a test checking for chrono::duration overflows · dc94eaab
      Jonathan Wakely authored
      This test fails if chrono::days::rep or chrono::years::rep is a 32-bit
      type, because a large days or years value silently overflows a 32-bit
      integer when converted to seconds. It would be conforming to implement
      chrono::days as chrono::duration<int32_t, ratio<86400>>, but would make
      this overflow case more likely. Similarly for chrono::years,
      chrono::months and chrono::weeks. This test is here to remind us not to
      make that change lightly.
      
      libstdc++-v3/ChangeLog:
      
      	* testsuite/20_util/duration/arithmetic/overflow_c++20.cc: New
      	test.
      dc94eaab
    • Jonathan Wakely's avatar
      libstdc++: Fix constraint on std::basic_format_string [PR108024] · 6c0f9584
      Jonathan Wakely authored
      Also remove some redundant std::move calls for return statements.
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/108024
      	* include/std/format (basic_format_string): Fix constraint.
      	* testsuite/std/format/format_string.cc: New test.
      6c0f9584
    • Jonathan Wakely's avatar
      libstdc++: Change names that clash with Win32 or Clang · cb363fd9
      Jonathan Wakely authored
      Clang now defines an __is_unsigned built-in, and Windows defines an
      _Out_ macro. Replace uses of those as identifiers.
      
      There might also be a problem with __is_signed, which we use in several
      places.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/chrono (hh_mm_ss): Rename __is_unsigned member to
      	_S_is_unsigned.
      	* include/std/format (basic_format_context): Rename _Out_
      	template parameter to _Out2.
      	* testsuite/17_intro/names.cc: Add Windows SAL annotation
      	macros.
      cb363fd9
    • Jonathan Wakely's avatar
      libstdc++: Define atomic lock-free type aliases for C++20 [PR98034] · 320ac807
      Jonathan Wakely authored
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/98034
      	* include/std/atomic (__cpp_lib_atomic_lock_free_type_aliases):
      	Define macro.
      	(atomic_signed_lock_free, atomic_unsigned_lock_free): Define
      	aliases.
      	* include/std/version (__cpp_lib_atomic_lock_free_type_aliases):
      	Define macro.
      	* testsuite/29_atomics/atomic/lock_free_aliases.cc: New test.
      320ac807
    • Jonathan Wakely's avatar
      libstdc++: Make operator<< for stacktraces less templated (LWG 3515) · 2327d933
      Jonathan Wakely authored
      This change was approved for C++23 last month.
      
      libstdc++-v3/ChangeLog:
      
      	* include/std/stacktrace (operator<<): Only output to narrow
      	ostreams (LWG 3515).
      	* testsuite/19_diagnostics/stacktrace/synopsis.cc:
      2327d933
    • Martin Liska's avatar
      mklog: do not parse binary file for PR entry · 14d0f82c
      Martin Liska authored
      contrib/ChangeLog:
      
      	* mklog.py: Do not search PR entry in a file that is binary.
      14d0f82c
    • Kyrylo Tkachov's avatar
      aarch64: Add __ARM_FEATURE_PAUTH and __ARM_FEATURE_BTI ACLE defines · 688f4eb2
      Kyrylo Tkachov authored
      Recent ACLE additions specified the __ARM_FEATURE_PAUTH and __ARM_FEATURE_BTI macros [1] that the compiler
      should define when the pointer authentication and BTI instructions are available (and don't act as NOPs).
      We've received requests to enable them in GCC for aarch64, similar to clang [2].
      It's a fairly simple patch and should be non-intrusive at this stage.
      Pointer authentication has its own "pauth" feature flag, whereas BTI depends on an architecture level
      of Armv8.5-a or later.
      
      Bootstrapped and tested on aarch64-none-linux-gnu.
      
      [1] https://github.com/ARM-software/acle/blob/main/main/acle.md#pointer-authentication
      [2] https://reviews.llvm.org/rG7d40baa82b1f272f68de63f3c4f68d970bdcd6ed
      
      gcc/ChangeLog:
      
      	* config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Define
      	__ARM_FEATURE_PAUTH and __ARM_FEATURE_BTI when appropriate.
      	* config/aarch64/aarch64.h (TARGET_BTI): Define.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.target/aarch64/acle/bti_def.c: New test.
      	* gcc.target/aarch64/acle/pauth_def.c: New test.
      688f4eb2
    • Richard Biener's avatar
      Revert parts of ADDR_EXPR/CONSTRUCTOR treatment change in match.pd · 49bf49bb
      Richard Biener authored
      This reverts the part that substitutes from the definition of an
      SSA name to the capture, thus ADDR_EXPR@0 eventually yielding
      &y_1->a[i_2] instead of _3.  That's because I didn't think of
      how to deal with substituting @0 in the result pattern.  So
      the following re-instantiates the SSA def CONSTRUCTOR handling
      and in the ADDR_EXPR helpers used by match.pd handles SSA names
      defined to ADDR_EXPRs transparently.
      
      	* genmatch.cc (dt_simplify::gen): Revert last change.
      	* match.pd: Revert simplification of CONSTUCTOR leaf handling.
      	(&x cmp SSA_NAME): Handle ADDR_EXPR in SSA defs.
      	* fold-const.cc (split_address_to_core_and_offset): Handle
      	ADDR_EXPRs in SSA defs.
      	(address_compare): Likewise.
      49bf49bb
    • Richard Biener's avatar
      tree-optimization/89317 - another pattern for &p->x != p + 4 · 2dc5d6b1
      Richard Biener authored
      As seen in the original testcase for PR89317 we are missing
      comparison simplification patterns for &p->x != p + 4.  Fixed
      by making an existing one apply.  To make the pattern apply
      during CCP we need to simplify ccp_fold to not use GENERIC
      folding of conditions but also use GIMPLE folding.
      
      	PR tree-optimization/89317
      	* tree-ssa-ccp.cc (ccp_fold): Handle GIMPLE_COND via
      	gimple_fold_stmt_to_constant_1.
      	* match.pd (&a != &a + c): Apply to pointer_plus with non-ADDR_EXPR
      	base as well.
      
      	* gcc.dg/tree-ssa/pr89317.c: Amend.
      2dc5d6b1
    • GCC Administrator's avatar
      Daily bump. · 324e9953
      GCC Administrator authored
      324e9953
  3. Dec 11, 2022
    • Steve Kargl's avatar
      Fortran: fix ICE on bad use of statement function [PR107995] · 8f72249f
      Steve Kargl authored
      gcc/fortran/ChangeLog:
      
      	PR fortran/107995
      	* interface.cc (gfc_check_dummy_characteristics): Reject statement
      	function dummy arguments.
      
      gcc/testsuite/ChangeLog:
      
      	PR fortran/107995
      	* gfortran.dg/pr107995.f90: New test.
      8f72249f
    • Iain Buclaw's avatar
      d: Fix internal compiler error: in visit, at d/imports.cc:72 (PR108050) · d9d8c967
      Iain Buclaw authored
      The visitor for lowering IMPORTED_DECLs did not have an override for
      dealing with importing OverloadSet symbols.  This has now been
      implemented in the code generator.
      
      	PR d/108050
      
      gcc/d/ChangeLog:
      
      	* decl.cc (DeclVisitor::visit (Import *)): Handle build_import_decl
      	returning a TREE_LIST.
      	* imports.cc (ImportVisitor::visit (OverloadSet *)): New override.
      
      gcc/testsuite/ChangeLog:
      
      	* gdc.dg/imports/pr108050/mod1.d: New.
      	* gdc.dg/imports/pr108050/mod2.d: New.
      	* gdc.dg/imports/pr108050/package.d: New.
      	* gdc.dg/pr108050.d: New test.
      d9d8c967
    • Martin Liska's avatar
      unidiff: use newline='\n' argument · b0451799
      Martin Liska authored
      In order to support CR on a line, we need to open files
      with newline='\n' as our line endings supposed to be of UNIX style.
      
      contrib/ChangeLog:
      
      	* check_GNU_style.py: Use newline=\n.
      	* check_GNU_style_lib.py: Simplify.
      	* gcc-changelog/git_commit.py: Fix issues seen
      	Rust patchset.
      	* gcc-changelog/git_email.py: Use newline argument.
      	* gcc-changelog/test_email.py: New test.
      	* gcc-changelog/test_patches.txt: New test.
      	* mklog.py: Use newline argument.
      b0451799
    • Iain Buclaw's avatar
      d: Merge upstream dmd, druntime c8ae4adb2e, phobos 792c8b7c1. · 6d799f0a
      Iain Buclaw authored
      D front-end changes:
      
      	- Import dmd v2.101.0.
      	- Deprecate the ability to call `__traits(getAttributes)' on
      	  overload sets.
      	- Deprecate non-empty `for' statement increment clause with no
      	  effect.
      	- Array literals assigned to `scope' array variables can now be
      	  allocated on the stack.
      
      D runtime changes:
      
      	- Import druntime v2.101.0.
      
      Phobos changes:
      
      	- Import phobos v2.101.0.
      
      gcc/d/ChangeLog:
      
      	* dmd/MERGE: Merge upstream dmd c8ae4adb2e.
      	* typeinfo.cc (check_typeinfo_type): Update for new front-end
      	interface.
      	(TypeInfoVisitor::visit (TypeInfoStructDeclaration *)): Remove warning
      	that toHash() must be declared 'nothrow @safe`.
      
      libphobos/ChangeLog:
      
      	* libdruntime/MERGE: Merge upstream druntime c8ae4adb2e.
      	* src/MERGE: Merge upstream phobos 792c8b7c1.
      6d799f0a
    • Iain Buclaw's avatar
      d: Expand bsr intrinsic as `clz(arg) ^ (argsize - 1)' · cc7f509d
      Iain Buclaw authored
      As well as removing unnecessary casts, this results in less temporaries
      being generated during the initial gimple lowering pass.  Otherwise the
      code generated is identical to the former intrinsic expansion.
      
      gcc/d/ChangeLog:
      
      	* intrinsics.cc (expand_intrinsic_bsf): Fix comment.
      	(expand_intrinsic_bsr): Use BIT_XOR_EXPR instead of MINUS_EXPR.
      cc7f509d
    • Richard Biener's avatar
      tree-optimization/89317 - missed folding of (p + 4) - &p->d · d13b86f9
      Richard Biener authored
      The PR notices we fail to simplify
      
        a_4 = &x_3(D)->data;
        b_5 = x_3(D) + 16;
        _1 = b_5 - a_4;
      
      together with the enabler handling ADDR_EXPR leafs in separate
      stmts in match.pd the suggested patterns work.
      
      	PR tree-optimization/89317
      	* match.pd ((p + b) - &p->c -> b - offsetof(c)): New patterns.
      
      	* gcc.dg/tree-ssa/pr89317.c: New testcase.
      d13b86f9
    • Richard Biener's avatar
      Treat ADDR_EXPR and CONSTRUCTOR as GIMPLE/GENERIC magically · 26295a06
      Richard Biener authored
      The following allows to match ADDR_EXPR for both the invariant
      &a.b case as well as the &p->d case in a separate definition
      transparently.  This also allows to remove the hack we employ
      for CONSTRUCTOR which we handle for example with
      
       (match vec_same_elem_p
        CONSTRUCTOR@0
        (if (TREE_CODE (@0) == SSA_NAME
             && uniform_vector_p (gimple_assign_rhs1 (SSA_NAME_DEF_STMT (@0))))))
      
      Note CONSTUCTORs always appear as separate definition in GIMPLE,
      but I continue to play safe and ADDR_EXPRs are now matched in
      both places where previously ADDR_EXPR@0 would have missed
      the &p->x case.
      
      This is a prerequesite for the PR89317 fix.
      
      	* genmatch.cc (dt_node::gen_kids): Handle ADDR_EXPR in both
      	the GENERIC and GIMPLE op position.
      	(dt_simplify::gen): Capture both GENERIC and GIMPLE op
      	position for ADDR_EXPR and CONSTRUCTOR.
      	* match.pd: Simplify CONSTRUCTOR leaf handling.
      
      	* gcc.dg/tree-ssa/forwprop-3.c: Adjust.
      	* g++.dg/tree-ssa/pr31146-2.C: Likewise.
      26295a06
    • Richard Biener's avatar
      tree-optimization/106904 - bogus -Wstringopt-overflow with vectors · f8d136e5
      Richard Biener authored
      The following avoids CSE of &ps->wp to &ps->wp.hwnd confusing
      -Wstringopt-overflow by making sure to produce addresses to the
      biggest container from vectorization.  For this I introduce
      strip_zero_offset_components which turns &ps->wp.hwnd into
      &(*ps) and use that to base the vector data references on.
      That will also work for addresses with variable components,
      alternatively emitting pointer arithmetic via calling
      get_inner_reference and gimplifying that would be possible
      but likely more intrusive.
      
      This is by no means a complete fix for all of those issues
      (avoiding ADDR_EXPRs in favor of pointer arithmetic might be).
      Other passes will have similar issues.
      
      In theory that might now cause false negatives.
      
      	PR tree-optimization/106904
      	* tree.h (strip_zero_offset_components): Declare.
      	* tree.cc (strip_zero_offset_components): Define.
      	* tree-vect-data-refs.cc (vect_create_addr_base_for_vector_ref):
      	Strip zero offset components before building the address.
      
      	* gcc.dg/Wstringop-overflow-pr106904.c: New testcase.
      f8d136e5
Loading