aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
AgeCommit message (Collapse)AuthorFilesLines
2023-12-14middle-end: Fix up constant handling in emit_conditional_move [PR111260]Andrew Pinski1-0/+9
After r14-2667-gceae1400cf24f329393e96dd9720, we force a constant to a register if it is shared with one of the other operands. The problem is used the comparison mode for the register but that could be different from the operand mode. This causes some issues on some targets. To fix it, we need to make sure the mode of the comparison matches the mode of the other operands, before we can compare the constants (CONST_INT has no modes so compare_rtx returns true if they have the same value even if the usage is in a different mode). Bootstrapped and tested on both aarch64-linux-gnu and x86_64-linux. PR middle-end/111260 gcc/ChangeLog: * optabs.cc (emit_conditional_move): Change the modes to be equal before forcing the constant to a register. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/condmove-1.c: New test. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2023-12-13[committed] Minor testsuite fallout from c99 changesJeff Law1-0/+2
The alpha port failed its weekly test due to a lack of a prototype for the syscall() routine. Fixed thusly and pushed to the trunk. gcc/testsuite * gcc.c-torture/execute/20001229-1.c: Prototype syscall().
2023-12-02[committed] Fix pr65369.cJeff Law1-1/+1
There's a caller/callee type mismatch in this test that shows up on targets where ints are something other than 32 bit types. Based on reviewing the original bug report, the fix and the part of the test this fixes, I'm reasonably confident this hasn't compromised the test. gcc/testsuite * gcc.c-torture/execute/pr65369.c: Fix type mismatch.
2023-12-02[committed] Fix comp-goto-1.c on 16 bit targetsJeff Law1-1/+1
I don't remember what port triggered this, but it's obviously that comp-goto-1.c needs to be fixed. Basically the test has two implementations. One is just a dummy with no return value on main() triggering the new errors. gcc/testsuite * gcc.c-torture/execute/comp-goto-1.c: Fix return value of main for 16 bit targets.
2023-11-29testsuite: move gcc.c-torture/compile/libcall-2.c to gcc.target/i386/libcall-1.cJose E. Marchesi1-10/+0
This patch relocates a test that is really x86 specific, and changes it to use check_effective_target_int128. gcc/testsuite/ChangeLog * gcc.c-torture/compile/libcall-2.c: Remove. * gcc.target/i386/libcall-1.c: Moved from gcc.c-torture/compile/libcall-2.c and adapted to use effective-target for int128_t.
2023-11-29testsuite: fix gcc.c-torture/compile/libcall-2.c in -m32Jose E. Marchesi1-0/+2
This test relies on having __int128 in x86_64 targets, which is only available in -m64. gcc/testsuite/ChangeLog * gcc.c-torture/compile/libcall-2.c: Skip test in -m32.
2023-11-28Emit funcall external declarations only if actually used.Jose E. Marchesi1-0/+8
There are many places in GCC where alternative local sequences are tried in order to determine what is the cheapest or best alternative to use in the current target. When any of these sequences involve a libcall, the current implementation of emit_library_call_value_1 introduce a side-effect consisting on emitting an external declaration for the funcall (such as __divdi3) which is thus emitted even if the sequence that does the libcall is not retained. This is problematic in targets such as BPF, because the kernel loader chokes on the spurious symbol __divdi3 and makes the resulting BPF object unloadable. Note that BPF objects are not linked before being loaded. This patch changes asssemble_external_libcall to defer emitting declarations of external libcall symbols, by saving the call tree nodes in a temporary list pending_libcall_symbols and letting process_pending_assembly_externals to emit them only if they have been referenced. Solution suggested and sketched by Richard Sandiford. Regtested in x86_64-linux-gnu. Tested with host x86_64-linux-gnu with target bpf-unknown-none. gcc/ChangeLog PR target/109253 * varasm.cc (pending_libcall_symbols): New variable. (process_pending_assemble_externals): Process pending_libcall_symbols. (assemble_external_libcall): Defer emitting external libcall symbols to process_pending_assemble_externals. gcc/testsuite/ChangeLog PR target/109253 * gcc.target/bpf/divmod-libcall-1.c: New test. * gcc.target/bpf/divmod-libcall-2.c: Likewise. * gcc.c-torture/compile/libcall-2.c: Likewise.
2023-11-25i386: Fix up *jcc_bt*_mask{,_1} [PR111408]Jakub Jelinek1-0/+26
The following testcase is miscompiled in GCC 14 because the *jcc_bt<mode>_mask and *jcc_bt<SWI48:mode>_mask_1 patterns have just one argument in (match_operator 0 "bt_comparison_operator" [...]) but as bt_comparison_operator is eq,ne, we need two. The md readers don't warn about it, after all, some checks can be done in the predicate rather than specified explicitly, and the behavior is that anything is accepted as the second argument. I went through all other i386.md match_operator uses and all others looked right (extract_operator using 3 operands, all others 2). I think we'll want to fix this at different spots in older releases because I think the bug was introduced already in 2008, though most likely just latent. 2023-11-25 Jakub Jelinek <jakub@redhat.com> PR target/111408 * config/i386/i386.md (*jcc_bt<mode>_mask, *jcc_bt<SWI48:mode>_mask_1): Add (const_int 0) as expected second operand of bt_comparison_operator. * gcc.c-torture/execute/pr111408.c: New test.
2023-11-20inter-procedural value range propagationJan Hubicka2-5/+5
implement very basic propapgation of return value ranges from VRP pass. This helps std::vector's push_back since we work out value range of allocated block. This propagates only within single translation unit. I hoped we will also do the propagation at WPA stage, but that needs more work on ipa-cp side. I also added code auto-detecting return_nonnull and corresponding -Wsuggest-attribute. gcc/ChangeLog: * cgraph.cc (add_detected_attribute_1): New function. (cgraph_node::add_detected_attribute): Likewise. * cgraph.h (cgraph_node::add_detected_attribute): Declare. * common.opt: Add -Wsuggest-attribute=returns_nonnull. * doc/invoke.texi: Document new flag. * gimple-range-fold.cc (fold_using_range::range_of_call): Use known reutrn value ranges. * ipa-prop.cc (struct ipa_return_value_summary): New type. (class ipa_return_value_sum_t): New type. (ipa_return_value_sum): New summary. (ipa_record_return_value_range): New function. (ipa_return_value_range): New function. * ipa-prop.h (ipa_return_value_range): Declare. (ipa_record_return_value_range): Declare. * ipa-pure-const.cc (warn_function_returns_nonnull): New funcion. * ipa-utils.h (warn_function_returns_nonnull): Declare. * symbol-summary.h: Fix comment. * tree-vrp.cc (execute_ranger_vrp): Record return values. gcc/testsuite/ChangeLog: * g++.dg/ipa/devirt-2.C: Add noipa attribute to prevent ipa-vrp. * g++.dg/ipa/devirt-7.C: Disable ipa-vrp. * g++.dg/ipa/ipa-icf-2.C: Disable ipa-vrp. * g++.dg/ipa/ipa-icf-3.C: Disable ipa-vrp. * g++.dg/ipa/ivinline-1.C: Disable ipa-vrp. * g++.dg/ipa/ivinline-3.C: Disable ipa-vrp. * g++.dg/ipa/ivinline-5.C: Disable ipa-vrp. * g++.dg/ipa/ivinline-8.C: Disable ipa-vrp. * g++.dg/ipa/nothrow-1.C: Disable ipa-vrp. * g++.dg/ipa/pure-const-1.C: Disable ipa-vrp. * g++.dg/ipa/pure-const-2.C: Disable ipa-vrp. * g++.dg/lto/inline-crossmodule-1_0.C: Disable ipa-vrp. * gcc.c-torture/compile/pr106433.c: Add noipa attribute to prevent ipa-vrp. * gcc.c-torture/execute/frame-address.c: Likewise. * gcc.dg/vla-1.c: Add noipa attribute to prevent ipa-vrp. * gcc.dg/ipa/fopt-info-inline-1.c: Disable ipa-vrp. * gcc.dg/ipa/ipa-icf-25.c: Disable ipa-vrp. * gcc.dg/ipa/ipa-icf-38.c: Disable ipa-vrp. * gcc.dg/ipa/pure-const-1.c: Disable ipa-vrp. * gcc.dg/ipa/remref-0.c: Add noipa attribute to prevent ipa-vrp. * gcc.dg/tree-prof/time-profiler-1.c: Disable ipa-vrp. * gcc.dg/tree-prof/time-profiler-2.c: Disable ipa-vrp. * gcc.dg/tree-ssa/pr110269.c: Disable ipa-vrp. * gcc.dg/tree-ssa/pr20701.c: Disable ipa-vrp. * gcc.dg/tree-ssa/vrp05.c: Disable ipa-vrp. * gcc.dg/tree-ssa/return-value-range-1.c: New test.
2023-11-16gcc.c-torture/execute/931004-13.c: Fix declaration of mainFlorian Weimer1-2/+2
gcc/testsuite/ * gcc.c-torture/execute/931004-13.c (main): Fix mistakenly swapped int/void types.
2023-11-13C99 testsuite readiness: Cleanup of execute testsFlorian Weimer291-337/+682
This change updates the gcc.c-torture/execute/ to avoid obsolete language constructs. In the changed tests, use of the features appears to be accidental, and updating allows the tests run with the default compiler flags. gcc/testsuite/ * gcc.c-torture/execute/20000112-1.c (main): Add missing int and void types. * gcc.c-torture/execute/20000113-1.c (foobar): Add missing void return type. (main): Add missing int and void types. * gcc.c-torture/execute/20000314-2.c (main): Likewise. * gcc.c-torture/execute/20000402-1.c (main): Likewise. * gcc.c-torture/execute/20000403-1.c (main): Likewise. * gcc.c-torture/execute/20000503-1.c (main): Likewise. * gcc.c-torture/execute/20000605-2.c (main): Likewise. * gcc.c-torture/execute/20000717-1.c (main): Likewise. * gcc.c-torture/execute/20000717-5.c (main): Likewise. * gcc.c-torture/execute/20000726-1.c (main): Likewise. * gcc.c-torture/execute/20000914-1.c(blah): Add missing void types. (main): Add missing int and void types. * gcc.c-torture/execute/20001009-1.c (main): Likewise. * gcc.c-torture/execute/20001013-1.c (main): Likewise. * gcc.c-torture/execute/20001031-1.c (main): Likewise. * gcc.c-torture/execute/20010221-1.c (main): Likewise. * gcc.c-torture/execute/20010723-1.c (main): Likewise. * gcc.c-torture/execute/20010915-1.c (s): Call __builtin_strcmp instead of strcmp. * gcc.c-torture/execute/20010924-1.c (main): Add missing int and void types. * gcc.c-torture/execute/20011128-1.c (main): Likewise. * gcc.c-torture/execute/20020226-1.c (main): Likewise. * gcc.c-torture/execute/20020328-1.c (foo): Add missing void types. * gcc.c-torture/execute/20020406-1.c (DUPFFexgcd): Call __builtin_printf instead of printf. (main): Likewise. * gcc.c-torture/execute/20020508-1.c (main): Add missing int and void types. * gcc.c-torture/execute/20020508-2.c (main): Likewise. * gcc.c-torture/execute/20020508-3.c (main): Likewise. * gcc.c-torture/execute/20020611-1.c (main): Likewise. * gcc.c-torture/execute/20021010-2.c (main): Likewise. * gcc.c-torture/execute/20021113-1.c (foo): Add missing void return type. (main): Add missing int and void types. * gcc.c-torture/execute/20021120-3.c (foo): Call __builtin_sprintf instead of sprintf. * gcc.c-torture/execute/20030125-1.c (main): Add missing int and void types. * gcc.c-torture/execute/20030216-1.c (main): Likewise. * gcc.c-torture/execute/20030404-1.c (main): Likewise. * gcc.c-torture/execute/20030606-1.c (main): Likewise. Call __builtin_memset instead of memset. * gcc.c-torture/execute/20030828-1.c (main): Add missing int and void types. * gcc.c-torture/execute/20030828-2.c (main): Likewise. * gcc.c-torture/execute/20031012-1.c: Call __builtin_strlen instead of strlen. * gcc.c-torture/execute/20031211-1.c (main): Add missing int and void types. * gcc.c-torture/execute/20040319-1.c (main): Likewise. * gcc.c-torture/execute/20040411-1.c (sub1): Call __builtin_memcpy instead of memcpy. * gcc.c-torture/execute/20040423-1.c (sub1): Likewise. * gcc.c-torture/execute/20040917-1.c (main): Add missing int and void types. * gcc.c-torture/execute/20050131-1.c (main): Likewise. * gcc.c-torture/execute/20051113-1.c (main): Likewise. * gcc.c-torture/execute/20121108-1.c (main): Call __builtin_printf instead of printf. * gcc.c-torture/execute/20170401-2.c (main): Add missing int and void types. * gcc.c-torture/execute/900409-1.c (main): Likewise. * gcc.c-torture/execute/920202-1.c (f): Add int return type. (main): Add missing int and void types. * gcc.c-torture/execute/920302-1.c (execute): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/920410-1.c (main): Likewise. * gcc.c-torture/execute/920501-2.c (main): Likewise. * gcc.c-torture/execute/920501-3.c (execute): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/920501-5.c (x): Add int return type. (main): Add missing int and void types. * gcc.c-torture/execute/920501-6.c (main): Add int return type. * gcc.c-torture/execute/920501-8.c (main): Add missing int and void types. Call __builtin_strcmp instead of strcmp. * gcc.c-torture/execute/920506-1.c (main): Add missing int and void types. * gcc.c-torture/execute/920612-2.c (main): Likewise. * gcc.c-torture/execute/920618-1.c (main): Likewise. * gcc.c-torture/execute/920625-1.c (main): Likewise. * gcc.c-torture/execute/920710-1.c (main): Likewise. * gcc.c-torture/execute/920721-1.c (main): Likewise. * gcc.c-torture/execute/920721-4.c (main): Likewise. * gcc.c-torture/execute/920726-1.c (first, second): Call __builtin_strlen instead of strlen. (main): Add missing int and void types. Call __builtin_strcmp instead of strcmp. * gcc.c-torture/execute/920810-1.c (main): Add missing int and void types. * gcc.c-torture/execute/920829-1.c (main): Likewise. * gcc.c-torture/execute/920908-1.c (main): Likewise. * gcc.c-torture/execute/920922-1.c (main): Likewise. * gcc.c-torture/execute/920929-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/921006-1.c (main): Likewise. Call __builtin_strcmp instead of strcmp. * gcc.c-torture/execute/921007-1.c (main): Add missing int and void types. * gcc.c-torture/execute/921016-1.c (main): Likewise. * gcc.c-torture/execute/921019-1.c (main): Likewise. * gcc.c-torture/execute/921019-2.c (main): Likewise. * gcc.c-torture/execute/921029-1.c (main): Likewise. * gcc.c-torture/execute/921104-1.c (main): Likewise. * gcc.c-torture/execute/921112-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/921113-1.c (w, f1, f2, gitter): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/921117-1.c (check): Call __builtin_strcmp instead of strcmp. (main): Add missing int and void types. Call __builtin_strcpy instead of strcpy. * gcc.c-torture/execute/921123-2.c (main): Add missing int and void types. * gcc.c-torture/execute/921202-2.c (main): Likewise. * gcc.c-torture/execute/921204-1.c (main): Likewise. * gcc.c-torture/execute/921208-1.c (main): Likewise. * gcc.c-torture/execute/930123-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/930126-1.c (main): Likewise. * gcc.c-torture/execute/930406-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/930408-1.c (p, f): Add missing void types. (main): Add missing int and void types. * gcc.c-torture/execute/930429-1.c (main): Likewise. * gcc.c-torture/execute/930603-2.c (f): Add missing void types. (main): Add missing int and void types. * gcc.c-torture/execute/930608-1.c (main): Likewise. * gcc.c-torture/execute/930614-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/930614-2.c (main): Likewise. * gcc.c-torture/execute/930622-2.c (main): Likewise. * gcc.c-torture/execute/930628-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/930725-1.c (main): Likewise. Call __builtin_strcmp instead of strcmp. * gcc.c-torture/execute/930930-2.c (main): Add missing int and void types. * gcc.c-torture/execute/931002-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-10.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-11.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-12.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-13.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-14.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-2.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-3.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-4.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-5.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-6.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-7.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-8.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931004-9.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/931005-1.c (main): Likewise. * gcc.c-torture/execute/931110-1.c (main): Likewise. * gcc.c-torture/execute/931110-2.c (main): Likewise. * gcc.c-torture/execute/941014-1.c (main): Likewise. * gcc.c-torture/execute/941014-2.c (main): Likewise. * gcc.c-torture/execute/941015-1.c (main): Likewise. * gcc.c-torture/execute/941021-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/941025-1.c (main): Likewise. * gcc.c-torture/execute/941031-1.c (main): Likewise. * gcc.c-torture/execute/950221-1.c (g2): Add int return type. (f): Add missing void types. Call __builtin_strcpy instead of strcpy. (main): Add missing int and void types. * gcc.c-torture/execute/950426-2.c (main): Likewise. * gcc.c-torture/execute/950503-1.c (main): Likewise. * gcc.c-torture/execute/950511-1.c (main): Likewise. * gcc.c-torture/execute/950607-1.c (main): Likewise. * gcc.c-torture/execute/950607-2.c (main): Likewise. * gcc.c-torture/execute/950612-1.c (main): Likewise. * gcc.c-torture/execute/950628-1.c (main): Likewise. * gcc.c-torture/execute/950704-1.c (main): Likewise. * gcc.c-torture/execute/950706-1.c (main): Likewise. * gcc.c-torture/execute/950710-1.c (main): Likewise. * gcc.c-torture/execute/950714-1.c (main): Likewise. * gcc.c-torture/execute/950809-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/950906-1.c (g, f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/950915-1.c (main): Likewise. * gcc.c-torture/execute/950929-1.c (main): Likewise. * gcc.c-torture/execute/951003-1.c (f): Add missing int parameter type. (main): Add missing int and void types. * gcc.c-torture/execute/951115-1.c (g, f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/951204-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/960116-1.c (p): Add int return type. (main): Add missing int and void types. * gcc.c-torture/execute/960117-1.c (main): Likewise. * gcc.c-torture/execute/960209-1.c (main): Likewise. * gcc.c-torture/execute/960215-1.c (main): Likewise. * gcc.c-torture/execute/960219-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/960301-1.c (main): Likewise. * gcc.c-torture/execute/960302-1.c (foo, main): Add missing int and void types. * gcc.c-torture/execute/960311-1.c (main): Likewise. * gcc.c-torture/execute/960311-2.c (main): Likewise. * gcc.c-torture/execute/960311-3.c (main): Likewise. * gcc.c-torture/execute/960312-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/960317-1.c (main): Likewise. * gcc.c-torture/execute/960321-1.c (main): Likewise. * gcc.c-torture/execute/960326-1.c (main): Likewise. * gcc.c-torture/execute/960327-1.c (g, main): Add missing int and void types. (f): Add missing void types. * gcc.c-torture/execute/960405-1.c (main): Add missing int and void types. * gcc.c-torture/execute/960416-1.c (main): Likewise. * gcc.c-torture/execute/960419-1.c (main): Likewise. * gcc.c-torture/execute/960419-2.c (main): Likewise. * gcc.c-torture/execute/960512-1.c (main): Likewise. * gcc.c-torture/execute/960513-1.c (main): Likewise. * gcc.c-torture/execute/960521-1.c (f): Add missing void types. (main): Add missing int and void types. * gcc.c-torture/execute/960608-1.c (f): Add int return type. (main): Add missing int and void types. * gcc.c-torture/execute/960801-1.c (main): Likewise. * gcc.c-torture/execute/960802-1.c (main): Likewise. * gcc.c-torture/execute/960909-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/961004-1.c (main): Likewise. * gcc.c-torture/execute/961017-1.c (main): Likewise. * gcc.c-torture/execute/961017-2.c (main): Likewise. * gcc.c-torture/execute/961026-1.c (main): Likewise. * gcc.c-torture/execute/961122-1.c (addhi, subhi): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/961122-2.c (main): Likewise. * gcc.c-torture/execute/961125-1.c (main): Likewise. * gcc.c-torture/execute/961206-1.c (main): Likewise. * gcc.c-torture/execute/961213-1.c (main): Likewise. * gcc.c-torture/execute/970214-1.c (main): Likewise. * gcc.c-torture/execute/970214-2.c (main): Likewise. * gcc.c-torture/execute/970217-1.c (sub): Add int return type. (main): Add missing int and void types. * gcc.c-torture/execute/970923-1.c (main): Likewise. * gcc.c-torture/execute/980223.c (main): Likewise. * gcc.c-torture/execute/980506-1.c (main): Likewise. * gcc.c-torture/execute/980506-2.c (main): Likewise. * gcc.c-torture/execute/980506-3.c (build_lookup): Call __builtin_strlen instead of strlen and __builtin_memset instead of memset. * gcc.c-torture/execute/980526-3.c (main): Likewise. * gcc.c-torture/execute/980602-1.c (main): Likewise. * gcc.c-torture/execute/980604-1.c (main): Likewise. * gcc.c-torture/execute/980605-1.c (dummy): Add missing int parameter type. (main): Add missing int and void types. * gcc.c-torture/execute/980701-1.c (ns_name_skip): Add missing int return type. (main): Add missing int and void types. * gcc.c-torture/execute/980709-1.c (main): Likewise. * gcc.c-torture/execute/990117-1.c (main): Likewise. * gcc.c-torture/execute/990127-1.c (main): Likewise. * gcc.c-torture/execute/990128-1.c (main): Likewise. * gcc.c-torture/execute/990130-1.c (main): Likewise. * gcc.c-torture/execute/990324-1.c (main): Likewise. * gcc.c-torture/execute/990524-1.c (main): Likewise. * gcc.c-torture/execute/990531-1.c (main): Likewise. * gcc.c-torture/execute/990628-1.c (fetch, load_data): Call __builtin_memset instead of memset. (main): Add missing int and void types. * gcc.c-torture/execute/991019-1.c (main): Likewise. * gcc.c-torture/execute/991023-1.c (foo, main): Likewise. * gcc.c-torture/execute/991112-1.c (isprint): Declare. * gcc.c-torture/execute/991118-1.c (main): Add missing int and void types. * gcc.c-torture/execute/alias-1.c (ptr2): Add cast to float * in initializer. (typepun): Add missing void types. (main): Add missing int and void types. * gcc.c-torture/execute/alias-2.c (main): Likewise. * gcc.c-torture/execute/alias-3.c (inc): Add missing void types. * gcc.c-torture/execute/alias-4.c (main): Add missing int return type. * gcc.c-torture/execute/arith-1.c (main): Add missing int and void types. * gcc.c-torture/execute/arith-rand-ll.c (main): Likewise. * gcc.c-torture/execute/arith-rand.c (main): Likewise. * gcc.c-torture/execute/bf-layout-1.c (main): Likewise. * gcc.c-torture/execute/bf-pack-1.c (foo): Add missing void return type. (main): Add missing int and void types. * gcc.c-torture/execute/bf-sign-1.c (main): Likewise. * gcc.c-torture/execute/bf-sign-2.c (main): Likewise. * gcc.c-torture/execute/bf64-1.c (main): Likewise. * gcc.c-torture/execute/builtin-prefetch-2.c (stat_int_arr): Add missing int array element type. * gcc.c-torture/execute/builtin-prefetch-3.c (stat_int_arr): Likewise. * gcc.c-torture/execute/cbrt.c (main): Add missing int and void types. * gcc.c-torture/execute/complex-1.c (main): Likewise. * gcc.c-torture/execute/complex-2.c (main): Likewise. * gcc.c-torture/execute/complex-3.c (main): Likewise. * gcc.c-torture/execute/complex-4.c (main): Likewise. * gcc.c-torture/execute/complex-5.c (main): Likewise. * gcc.c-torture/execute/compndlit-1.c (main): Likewise. * gcc.c-torture/execute/conversion.c (test_integer_to_float) (test_longlong_integer_to_float, test_float_to_integer) (test_float_to_longlong_integer): Add missing void return type. (main): Add missing int and void types. * gcc.c-torture/execute/cvt-1.c (main): Likewise. * gcc.c-torture/execute/divconst-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/divconst-2.c (main): Likewise. * gcc.c-torture/execute/divconst-3.c (main): Likewise. * gcc.c-torture/execute/enum-1.c (main): Likewise. * gcc.c-torture/execute/func-ptr-1.c (main): Likewise. * gcc.c-torture/execute/ieee/20011123-1.c (main): Likewise. * gcc.c-torture/execute/ieee/920518-1.c (main): Likewise. * gcc.c-torture/execute/ieee/920810-1.c (main): Likewise. Call __builtin_strcmp instead of strcmp. * gcc.c-torture/execute/ieee/930529-1.c (main): Add missing int and void types. * gcc.c-torture/execute/ieee/fp-cmp-1.c (main): Likewise. * gcc.c-torture/execute/ieee/fp-cmp-2.c (main): Likewise. * gcc.c-torture/execute/ieee/fp-cmp-3.c (main): Likewise. * gcc.c-torture/execute/ieee/fp-cmp-6.c (main): Likewise. * gcc.c-torture/execute/ieee/fp-cmp-9.c (main): Likewise. * gcc.c-torture/execute/ieee/minuszero.c (main): Likewise. * gcc.c-torture/execute/ieee/mzero2.c (expect): Call __builtin_memcmp instead of memcmp. (main): Add missing int and void types. * gcc.c-torture/execute/ieee/mzero3.c (main): Likewise. (expectd, expectf): Call __builtin_memcmp instead of memcmp. * gcc.c-torture/execute/ieee/mzero5.c (negzero_check): Likewise. * gcc.c-torture/execute/ieee/rbug.c (main): Add missing int and void types. * gcc.c-torture/execute/index-1.c (main): Likewise. * gcc.c-torture/execute/loop-1.c (main): Likewise. * gcc.c-torture/execute/loop-2b.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/loop-6.c (main): Likewise. * gcc.c-torture/execute/loop-7.c (main): Likewise. * gcc.c-torture/execute/lto-tbaa-1.c (use_a, set_b, use_c): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/memcpy-1.c (main): Likewise. * gcc.c-torture/execute/memcpy-2.c (main): Likewise. * gcc.c-torture/execute/memcpy-bi.c (main): Likewise. * gcc.c-torture/execute/memset-1.c (main): Likewise. * gcc.c-torture/execute/memset-2.c: Include <string.h>. * gcc.c-torture/execute/memset-3.c: Likewise. * gcc.c-torture/execute/nest-stdar-1.c (main): Add missing int and void types. * gcc.c-torture/execute/nestfunc-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/packed-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/pr15262-1.c (main): Likewise. Call __builtin_malloc instead of malloc. * gcc.c-torture/execute/pr15262-2.c (foo): Add int return type. (main): Add missing int and void types. * gcc.c-torture/execute/pr15262.c (main): Likewise. * gcc.c-torture/execute/pr17252.c (main): Likewise. * gcc.c-torture/execute/pr21331.c (main): Likewise. * gcc.c-torture/execute/pr34176.c (foo): Add missing int type to definition of foo. * gcc.c-torture/execute/pr42231.c (max): Add missing int type to definition. * gcc.c-torture/execute/pr42614.c (expect_func): Call __builtin_abs instead of abs. * gcc.c-torture/execute/pr54937.c (t): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/ptr-arith-1.c (main): Likewise. * gcc.c-torture/execute/regstack-1.c (main): Likewise. * gcc.c-torture/execute/scope-1.c (f): Add missing void types. (main): Add missing int and void types. * gcc.c-torture/execute/simd-5.c (main): Call __builtin_memcmp instead of memcmp. * gcc.c-torture/execute/strcmp-1.c (main): Add missing int and void types. * gcc.c-torture/execute/strcpy-1.c (main): Likewise. * gcc.c-torture/execute/strct-pack-1.c (main): Likewise. * gcc.c-torture/execute/strct-pack-2.c (main): Likewise. * gcc.c-torture/execute/strct-pack-4.c (main): Likewise. * gcc.c-torture/execute/strct-stdarg-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/strct-varg-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/strlen-1.c (main): Likewise. * gcc.c-torture/execute/strncmp-1.c (main): Likewise. * gcc.c-torture/execute/struct-ini-1.c (main): Likewise. * gcc.c-torture/execute/struct-ini-2.c (main): Likewise. * gcc.c-torture/execute/struct-ini-3.c (main): Likewise. * gcc.c-torture/execute/struct-ini-4.c (main): Likewise. * gcc.c-torture/execute/struct-ret-1.c (main): Likewise. * gcc.c-torture/execute/struct-ret-2.c (main): Likewise. * gcc.c-torture/execute/va-arg-1.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/va-arg-10.c (main): Likewise. * gcc.c-torture/execute/va-arg-2.c (main): Likewise. * gcc.c-torture/execute/va-arg-4.c (main): Likewise. * gcc.c-torture/execute/va-arg-5.c (va_double) (va_long_double): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/va-arg-6.c (f): Add void return type. (main): Add missing int and void types. * gcc.c-torture/execute/va-arg-9.c (main): Likewise. * gcc.c-torture/execute/widechar-1.c (main): Likewise.
2023-11-13C99 testsuite readiness: Add missing abort, exit declarationsFlorian Weimer529-3/+1453
The execute tests use abort/exit to report failure/success, but they generally do not declare these functions (or include <stdlib.h>). This change adds declarations as appropriate. It would have been possible to switch to __builtin_abort and __builtin_exit instead. Existing practice varies. Adding the declarations makes it easier to write the GNU-style commit message because it is not necessary to mention the function with the call site. Instead of this change, it would be possible to create a special header file with the declarations that is included during the test file compilation using -include, but that would mean that many tests would no longer build standalone. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/20000112-1.c: Declare exit and abort as appropriate. * gcc.c-torture/execute/20000113-1.c: Likewise. * gcc.c-torture/execute/20000205-1.c: Likewise. * gcc.c-torture/execute/20000217-1.c: Likewise. * gcc.c-torture/execute/20000223-1.c: Likewise. * gcc.c-torture/execute/20000224-1.c: Likewise. * gcc.c-torture/execute/20000225-1.c: Likewise. * gcc.c-torture/execute/20000227-1.c: Likewise. * gcc.c-torture/execute/20000313-1.c: Likewise. * gcc.c-torture/execute/20000314-1.c: Likewise. * gcc.c-torture/execute/20000314-2.c: Likewise. * gcc.c-torture/execute/20000314-3.c: Likewise. * gcc.c-torture/execute/20000402-1.c: Likewise. * gcc.c-torture/execute/20000403-1.c: Likewise. * gcc.c-torture/execute/20000412-1.c: Likewise. * gcc.c-torture/execute/20000412-2.c: Likewise. * gcc.c-torture/execute/20000412-4.c: Likewise. * gcc.c-torture/execute/20000412-5.c: Likewise. * gcc.c-torture/execute/20000412-6.c: Likewise. * gcc.c-torture/execute/20000419-1.c: Likewise. * gcc.c-torture/execute/20000422-1.c: Likewise. * gcc.c-torture/execute/20000503-1.c: Likewise. * gcc.c-torture/execute/20000511-1.c: Likewise. * gcc.c-torture/execute/20000519-1.c: Likewise. * gcc.c-torture/execute/20000519-2.c: Likewise. * gcc.c-torture/execute/20000523-1.c: Likewise. * gcc.c-torture/execute/20000528-1.c: Likewise. * gcc.c-torture/execute/20000603-1.c: Likewise. * gcc.c-torture/execute/20000605-1.c: Likewise. * gcc.c-torture/execute/20000605-2.c: Likewise. * gcc.c-torture/execute/20000605-3.c: Likewise. * gcc.c-torture/execute/20000622-1.c: Likewise. * gcc.c-torture/execute/20000717-1.c: Likewise. * gcc.c-torture/execute/20000717-2.c: Likewise. * gcc.c-torture/execute/20000717-5.c: Likewise. * gcc.c-torture/execute/20000722-1.c: Likewise. * gcc.c-torture/execute/20000726-1.c: Likewise. * gcc.c-torture/execute/20000731-1.c: Likewise. * gcc.c-torture/execute/20000731-2.c: Likewise. * gcc.c-torture/execute/20000801-3.c: Likewise. * gcc.c-torture/execute/20000801-4.c: Likewise. * gcc.c-torture/execute/20000808-1.c: Likewise. * gcc.c-torture/execute/20000815-1.c: Likewise. * gcc.c-torture/execute/20000818-1.c: Likewise. * gcc.c-torture/execute/20000819-1.c: Likewise. * gcc.c-torture/execute/20000822-1.c: Likewise. * gcc.c-torture/execute/20000914-1.c: Likewise. * gcc.c-torture/execute/20000917-1.c: Likewise. * gcc.c-torture/execute/20001009-1.c: Likewise. * gcc.c-torture/execute/20001009-2.c: Likewise. * gcc.c-torture/execute/20001013-1.c: Likewise. * gcc.c-torture/execute/20001017-1.c: Likewise. * gcc.c-torture/execute/20001017-2.c: Likewise. * gcc.c-torture/execute/20001024-1.c: Likewise. * gcc.c-torture/execute/20001027-1.c: Likewise. * gcc.c-torture/execute/20001101.c: Likewise. * gcc.c-torture/execute/20001108-1.c: Likewise. * gcc.c-torture/execute/20001112-1.c: Likewise. * gcc.c-torture/execute/20001124-1.c: Likewise. * gcc.c-torture/execute/20001130-1.c: Likewise. * gcc.c-torture/execute/20001130-2.c: Likewise. * gcc.c-torture/execute/20001203-2.c: Likewise. * gcc.c-torture/execute/20001221-1.c: Likewise. * gcc.c-torture/execute/20001228-1.c: Likewise. * gcc.c-torture/execute/20001229-1.c: Likewise. * gcc.c-torture/execute/20010106-1.c: Likewise. * gcc.c-torture/execute/20010118-1.c: Likewise. * gcc.c-torture/execute/20010119-1.c: Likewise. * gcc.c-torture/execute/20010206-1.c: Likewise. * gcc.c-torture/execute/20010209-1.c: Likewise. * gcc.c-torture/execute/20010221-1.c: Likewise. * gcc.c-torture/execute/20010222-1.c: Likewise. * gcc.c-torture/execute/20010329-1.c: Likewise. * gcc.c-torture/execute/20010403-1.c: Likewise. * gcc.c-torture/execute/20010409-1.c: Likewise. * gcc.c-torture/execute/20010422-1.c: Likewise. * gcc.c-torture/execute/20010518-1.c: Likewise. * gcc.c-torture/execute/20010518-2.c: Likewise. * gcc.c-torture/execute/20010520-1.c: Likewise. * gcc.c-torture/execute/20010604-1.c: Likewise. * gcc.c-torture/execute/20010711-1.c: Likewise. * gcc.c-torture/execute/20010723-1.c: Likewise. * gcc.c-torture/execute/20010904-1.c: Likewise. * gcc.c-torture/execute/20010904-2.c: Likewise. * gcc.c-torture/execute/20010915-1.c: Likewise. * gcc.c-torture/execute/20010924-1.c: Likewise. * gcc.c-torture/execute/20011024-1.c: Likewise. * gcc.c-torture/execute/20011109-1.c: Likewise. * gcc.c-torture/execute/20011109-2.c: Likewise. * gcc.c-torture/execute/20011114-1.c: Likewise. * gcc.c-torture/execute/20011121-1.c: Likewise. * gcc.c-torture/execute/20011126-1.c: Likewise. * gcc.c-torture/execute/20011128-1.c: Likewise. * gcc.c-torture/execute/20011217-1.c: Likewise. * gcc.c-torture/execute/20020213-1.c: Likewise. * gcc.c-torture/execute/20020215-1.c: Likewise. * gcc.c-torture/execute/20020225-2.c: Likewise. * gcc.c-torture/execute/20020226-1.c: Likewise. * gcc.c-torture/execute/20020227-1.c: Likewise. * gcc.c-torture/execute/20020307-1.c: Likewise. * gcc.c-torture/execute/20020328-1.c: Likewise. * gcc.c-torture/execute/20020404-1.c: Likewise. * gcc.c-torture/execute/20020406-1.c: Likewise. * gcc.c-torture/execute/20020413-1.c: Likewise. * gcc.c-torture/execute/20020418-1.c: Likewise. * gcc.c-torture/execute/20020508-1.c: Likewise. * gcc.c-torture/execute/20020508-2.c: Likewise. * gcc.c-torture/execute/20020508-3.c: Likewise. * gcc.c-torture/execute/20020529-1.c: Likewise. * gcc.c-torture/execute/20020611-1.c: Likewise. * gcc.c-torture/execute/20020615-1.c: Likewise. * gcc.c-torture/execute/20020619-1.c: Likewise. * gcc.c-torture/execute/20020904-1.c: Likewise. * gcc.c-torture/execute/20020916-1.c: Likewise. * gcc.c-torture/execute/20021010-1.c: Likewise. * gcc.c-torture/execute/20021113-1.c: Likewise. * gcc.c-torture/execute/20021118-1.c: Likewise. * gcc.c-torture/execute/20021118-2.c: Likewise. * gcc.c-torture/execute/20021120-1.c: Likewise. * gcc.c-torture/execute/20021120-2.c: Likewise. * gcc.c-torture/execute/20021120-3.c: Likewise. * gcc.c-torture/execute/20030105-1.c: Likewise. * gcc.c-torture/execute/20030109-1.c: Likewise. * gcc.c-torture/execute/20030117-1.c: Likewise. * gcc.c-torture/execute/20030120-1.c: Likewise. * gcc.c-torture/execute/20030125-1.c: Likewise. * gcc.c-torture/execute/20030128-1.c: Likewise. * gcc.c-torture/execute/20030209-1.c: Likewise. * gcc.c-torture/execute/20030222-1.c: Likewise. * gcc.c-torture/execute/20030316-1.c: Likewise. * gcc.c-torture/execute/20030403-1.c: Likewise. * gcc.c-torture/execute/20030404-1.c: Likewise. * gcc.c-torture/execute/20030501-1.c: Likewise. * gcc.c-torture/execute/20030606-1.c: Likewise. * gcc.c-torture/execute/20030828-1.c: Likewise. * gcc.c-torture/execute/20030828-2.c: Likewise. * gcc.c-torture/execute/20030903-1.c: Likewise. * gcc.c-torture/execute/20030910-1.c: Likewise. * gcc.c-torture/execute/20030913-1.c: Likewise. * gcc.c-torture/execute/20030914-1.c: Likewise. * gcc.c-torture/execute/20030914-2.c: Likewise. * gcc.c-torture/execute/20030916-1.c: Likewise. * gcc.c-torture/execute/20030928-1.c: Likewise. * gcc.c-torture/execute/20031010-1.c: Likewise. * gcc.c-torture/execute/20031201-1.c: Likewise. * gcc.c-torture/execute/20031204-1.c: Likewise. * gcc.c-torture/execute/20031211-1.c: Likewise. * gcc.c-torture/execute/20040208-1.c: Likewise. * gcc.c-torture/execute/20040218-1.c: Likewise. * gcc.c-torture/execute/20040307-1.c: Likewise. * gcc.c-torture/execute/20040319-1.c: Likewise. * gcc.c-torture/execute/20040411-1.c: Likewise. * gcc.c-torture/execute/20040423-1.c: Likewise. * gcc.c-torture/execute/20040625-1.c: Likewise. * gcc.c-torture/execute/20040703-1.c: Likewise. * gcc.c-torture/execute/20040706-1.c: Likewise. * gcc.c-torture/execute/20040707-1.c: Likewise. * gcc.c-torture/execute/20040805-1.c: Likewise. * gcc.c-torture/execute/20040917-1.c: Likewise. * gcc.c-torture/execute/20041011-1.c: Likewise. * gcc.c-torture/execute/20041113-1.c: Likewise. * gcc.c-torture/execute/20041124-1.c: Likewise. * gcc.c-torture/execute/20041210-1.c: Likewise. * gcc.c-torture/execute/20041212-1.c: Likewise. * gcc.c-torture/execute/20050410-1.c: Likewise. * gcc.c-torture/execute/20051113-1.c: Likewise. * gcc.c-torture/execute/20070623-1.c: Likewise. * gcc.c-torture/execute/20091229-1.c: Likewise. * gcc.c-torture/execute/20101025-1.c: Likewise. * gcc.c-torture/execute/20120817-1.c: Likewise. * gcc.c-torture/execute/20170401-2.c: Likewise. * gcc.c-torture/execute/900409-1.c: Likewise. * gcc.c-torture/execute/920202-1.c: Likewise. * gcc.c-torture/execute/920302-1.c: Likewise. * gcc.c-torture/execute/920410-1.c: Likewise. * gcc.c-torture/execute/920501-2.c: Likewise. * gcc.c-torture/execute/920501-3.c: Likewise. * gcc.c-torture/execute/920501-4.c: Likewise. * gcc.c-torture/execute/920501-5.c: Likewise. * gcc.c-torture/execute/920501-6.c: Likewise. * gcc.c-torture/execute/920501-8.c: Likewise. * gcc.c-torture/execute/920506-1.c: Likewise. * gcc.c-torture/execute/920604-1.c: Likewise. * gcc.c-torture/execute/920612-2.c: Likewise. * gcc.c-torture/execute/920618-1.c: Likewise. * gcc.c-torture/execute/920625-1.c: Likewise. * gcc.c-torture/execute/920710-1.c: Likewise. * gcc.c-torture/execute/920721-1.c: Likewise. * gcc.c-torture/execute/920721-4.c: Likewise. * gcc.c-torture/execute/920726-1.c: Likewise. * gcc.c-torture/execute/920829-1.c: Likewise. * gcc.c-torture/execute/920908-1.c: Likewise. * gcc.c-torture/execute/920922-1.c: Likewise. * gcc.c-torture/execute/920929-1.c: Likewise. * gcc.c-torture/execute/921006-1.c: Likewise. * gcc.c-torture/execute/921007-1.c: Likewise. * gcc.c-torture/execute/921016-1.c: Likewise. * gcc.c-torture/execute/921019-1.c: Likewise. * gcc.c-torture/execute/921019-2.c: Likewise. * gcc.c-torture/execute/921029-1.c: Likewise. * gcc.c-torture/execute/921104-1.c: Likewise. * gcc.c-torture/execute/921112-1.c: Likewise. * gcc.c-torture/execute/921113-1.c: Likewise. * gcc.c-torture/execute/921117-1.c: Likewise. * gcc.c-torture/execute/921123-2.c: Likewise. * gcc.c-torture/execute/921202-2.c: Likewise. * gcc.c-torture/execute/921204-1.c: Likewise. * gcc.c-torture/execute/921208-1.c: Likewise. * gcc.c-torture/execute/930123-1.c: Likewise. * gcc.c-torture/execute/930126-1.c: Likewise. * gcc.c-torture/execute/930406-1.c: Likewise. * gcc.c-torture/execute/930408-1.c: Likewise. * gcc.c-torture/execute/930429-1.c: Likewise. * gcc.c-torture/execute/930603-2.c: Likewise. * gcc.c-torture/execute/930608-1.c: Likewise. * gcc.c-torture/execute/930614-1.c: Likewise. * gcc.c-torture/execute/930614-2.c: Likewise. * gcc.c-torture/execute/930622-2.c: Likewise. * gcc.c-torture/execute/930628-1.c: Likewise. * gcc.c-torture/execute/930725-1.c: Likewise. * gcc.c-torture/execute/930930-2.c: Likewise. * gcc.c-torture/execute/931002-1.c: Likewise. * gcc.c-torture/execute/931004-1.c: Likewise. * gcc.c-torture/execute/931004-10.c: Likewise. * gcc.c-torture/execute/931004-11.c: Likewise. * gcc.c-torture/execute/931004-12.c: Likewise. * gcc.c-torture/execute/931004-13.c: Likewise. * gcc.c-torture/execute/931004-14.c: Likewise. * gcc.c-torture/execute/931004-2.c: Likewise. * gcc.c-torture/execute/931004-3.c: Likewise. * gcc.c-torture/execute/931004-4.c: Likewise. * gcc.c-torture/execute/931004-5.c: Likewise. * gcc.c-torture/execute/931004-6.c: Likewise. * gcc.c-torture/execute/931004-7.c: Likewise. * gcc.c-torture/execute/931004-8.c: Likewise. * gcc.c-torture/execute/931004-9.c: Likewise. * gcc.c-torture/execute/931005-1.c: Likewise. * gcc.c-torture/execute/931110-1.c: Likewise. * gcc.c-torture/execute/931110-2.c: Likewise. * gcc.c-torture/execute/941014-1.c: Likewise. * gcc.c-torture/execute/941015-1.c: Likewise. * gcc.c-torture/execute/941021-1.c: Likewise. * gcc.c-torture/execute/941025-1.c: Likewise. * gcc.c-torture/execute/941031-1.c: Likewise. * gcc.c-torture/execute/950221-1.c: Likewise. * gcc.c-torture/execute/950426-2.c: Likewise. * gcc.c-torture/execute/950503-1.c: Likewise. * gcc.c-torture/execute/950511-1.c: Likewise. * gcc.c-torture/execute/950607-1.c: Likewise. * gcc.c-torture/execute/950607-2.c: Likewise. * gcc.c-torture/execute/950612-1.c: Likewise. * gcc.c-torture/execute/950628-1.c: Likewise. * gcc.c-torture/execute/950704-1.c: Likewise. * gcc.c-torture/execute/950706-1.c: Likewise. * gcc.c-torture/execute/950710-1.c: Likewise. * gcc.c-torture/execute/950714-1.c: Likewise. * gcc.c-torture/execute/950809-1.c: Likewise. * gcc.c-torture/execute/950906-1.c: Likewise. * gcc.c-torture/execute/950915-1.c: Likewise. * gcc.c-torture/execute/950929-1.c: Likewise. * gcc.c-torture/execute/951003-1.c: Likewise. * gcc.c-torture/execute/951115-1.c: Likewise. * gcc.c-torture/execute/951204-1.c: Likewise. * gcc.c-torture/execute/960116-1.c: Likewise. * gcc.c-torture/execute/960117-1.c: Likewise. * gcc.c-torture/execute/960209-1.c: Likewise. * gcc.c-torture/execute/960215-1.c: Likewise. * gcc.c-torture/execute/960219-1.c: Likewise. * gcc.c-torture/execute/960301-1.c: Likewise. * gcc.c-torture/execute/960302-1.c: Likewise. * gcc.c-torture/execute/960311-1.c: Likewise. * gcc.c-torture/execute/960311-2.c: Likewise. * gcc.c-torture/execute/960311-3.c: Likewise. * gcc.c-torture/execute/960312-1.c: Likewise. * gcc.c-torture/execute/960317-1.c: Likewise. * gcc.c-torture/execute/960321-1.c: Likewise. * gcc.c-torture/execute/960326-1.c: Likewise. * gcc.c-torture/execute/960327-1.c: Likewise. * gcc.c-torture/execute/960405-1.c: Likewise. * gcc.c-torture/execute/960416-1.c: Likewise. * gcc.c-torture/execute/960419-1.c: Likewise. * gcc.c-torture/execute/960419-2.c: Likewise. * gcc.c-torture/execute/960512-1.c: Likewise. * gcc.c-torture/execute/960513-1.c: Likewise. * gcc.c-torture/execute/960608-1.c: Likewise. * gcc.c-torture/execute/960801-1.c: Likewise. * gcc.c-torture/execute/960802-1.c: Likewise. * gcc.c-torture/execute/960909-1.c: Likewise. * gcc.c-torture/execute/961004-1.c: Likewise. * gcc.c-torture/execute/961017-1.c: Likewise. * gcc.c-torture/execute/961017-2.c: Likewise. * gcc.c-torture/execute/961026-1.c: Likewise. * gcc.c-torture/execute/961122-1.c: Likewise. * gcc.c-torture/execute/961122-2.c: Likewise. * gcc.c-torture/execute/961125-1.c: Likewise. * gcc.c-torture/execute/961206-1.c: Likewise. * gcc.c-torture/execute/961213-1.c: Likewise. * gcc.c-torture/execute/970214-1.c: Likewise. * gcc.c-torture/execute/970214-2.c: Likewise. * gcc.c-torture/execute/970217-1.c: Likewise. * gcc.c-torture/execute/970923-1.c: Likewise. * gcc.c-torture/execute/980205.c: Likewise. * gcc.c-torture/execute/980223.c: Likewise. * gcc.c-torture/execute/980424-1.c: Likewise. * gcc.c-torture/execute/980505-1.c: Likewise. * gcc.c-torture/execute/980505-2.c: Likewise. * gcc.c-torture/execute/980506-1.c: Likewise. * gcc.c-torture/execute/980506-2.c: Likewise. * gcc.c-torture/execute/980506-3.c: Likewise. * gcc.c-torture/execute/980526-1.c: Likewise. * gcc.c-torture/execute/980526-2.c: Likewise. * gcc.c-torture/execute/980526-3.c: Likewise. * gcc.c-torture/execute/980602-1.c: Likewise. * gcc.c-torture/execute/980602-2.c: Likewise. * gcc.c-torture/execute/980604-1.c: Likewise. * gcc.c-torture/execute/980605-1.c: Likewise. * gcc.c-torture/execute/980612-1.c: Likewise. * gcc.c-torture/execute/980617-1.c: Likewise. * gcc.c-torture/execute/980618-1.c: Likewise. * gcc.c-torture/execute/980701-1.c: Likewise. * gcc.c-torture/execute/980709-1.c: Likewise. * gcc.c-torture/execute/980716-1.c: Likewise. * gcc.c-torture/execute/980929-1.c: Likewise. * gcc.c-torture/execute/981001-1.c: Likewise. * gcc.c-torture/execute/981019-1.c: Likewise. * gcc.c-torture/execute/981130-1.c: Likewise. * gcc.c-torture/execute/981206-1.c: Likewise. * gcc.c-torture/execute/990106-2.c: Likewise. * gcc.c-torture/execute/990117-1.c: Likewise. * gcc.c-torture/execute/990128-1.c: Likewise. * gcc.c-torture/execute/990130-1.c: Likewise. * gcc.c-torture/execute/990208-1.c: Likewise. * gcc.c-torture/execute/990222-1.c: Likewise. * gcc.c-torture/execute/990324-1.c: Likewise. * gcc.c-torture/execute/990326-1.c: Likewise. * gcc.c-torture/execute/990404-1.c: Likewise. * gcc.c-torture/execute/990513-1.c: Likewise. * gcc.c-torture/execute/990524-1.c: Likewise. * gcc.c-torture/execute/990525-1.c: Likewise. * gcc.c-torture/execute/990525-2.c: Likewise. * gcc.c-torture/execute/990527-1.c: Likewise. * gcc.c-torture/execute/990531-1.c: Likewise. * gcc.c-torture/execute/990604-1.c: Likewise. * gcc.c-torture/execute/990804-1.c: Likewise. * gcc.c-torture/execute/990811-1.c: Likewise. * gcc.c-torture/execute/990826-0.c: Likewise. * gcc.c-torture/execute/990827-1.c: Likewise. * gcc.c-torture/execute/990829-1.c: Likewise. * gcc.c-torture/execute/990923-1.c: Likewise. * gcc.c-torture/execute/991014-1.c: Likewise. * gcc.c-torture/execute/991016-1.c: Likewise. * gcc.c-torture/execute/991019-1.c: Likewise. * gcc.c-torture/execute/991023-1.c: Likewise. * gcc.c-torture/execute/991030-1.c: Likewise. * gcc.c-torture/execute/991112-1.c: Likewise. * gcc.c-torture/execute/991118-1.c: Likewise. * gcc.c-torture/execute/991201-1.c: Likewise. * gcc.c-torture/execute/991202-1.c: Likewise. * gcc.c-torture/execute/991202-2.c: Likewise. * gcc.c-torture/execute/991202-3.c: Likewise. * gcc.c-torture/execute/991216-1.c: Likewise. * gcc.c-torture/execute/991216-2.c: Likewise. * gcc.c-torture/execute/991216-4.c: Likewise. * gcc.c-torture/execute/991221-1.c: Likewise. * gcc.c-torture/execute/991227-1.c: Likewise. * gcc.c-torture/execute/991228-1.c: Likewise. * gcc.c-torture/execute/align-1.c: Likewise. * gcc.c-torture/execute/align-2.c: Likewise. * gcc.c-torture/execute/align-3.c: Likewise. * gcc.c-torture/execute/alloca-1.c: Likewise. * gcc.c-torture/execute/anon-1.c: Likewise. * gcc.c-torture/execute/arith-1.c: Likewise. * gcc.c-torture/execute/arith-rand-ll.c: Likewise. * gcc.c-torture/execute/arith-rand.c: Likewise. * gcc.c-torture/execute/bf-layout-1.c: Likewise. * gcc.c-torture/execute/bf-pack-1.c: Likewise. * gcc.c-torture/execute/bf-sign-1.c: Likewise. * gcc.c-torture/execute/bf-sign-2.c: Likewise. * gcc.c-torture/execute/bf64-1.c: Likewise. * gcc.c-torture/execute/builtin-constant.c: Likewise. * gcc.c-torture/execute/builtin-prefetch-1.c: Likewise. * gcc.c-torture/execute/builtin-prefetch-2.c: Likewise. * gcc.c-torture/execute/builtin-prefetch-3.c: Likewise. * gcc.c-torture/execute/builtin-prefetch-4.c: Likewise. * gcc.c-torture/execute/builtin-prefetch-5.c: Likewise. * gcc.c-torture/execute/builtin-prefetch-6.c: Likewise. * gcc.c-torture/execute/builtin-types-compatible-p.c: Likewise. * gcc.c-torture/execute/cbrt.c: Likewise. * gcc.c-torture/execute/complex-1.c: Likewise. * gcc.c-torture/execute/complex-2.c: Likewise. * gcc.c-torture/execute/complex-3.c: Likewise. * gcc.c-torture/execute/complex-4.c: Likewise. * gcc.c-torture/execute/complex-5.c: Likewise. * gcc.c-torture/execute/compndlit-1.c: Likewise. * gcc.c-torture/execute/conversion.c: Likewise. * gcc.c-torture/execute/cvt-1.c: Likewise. * gcc.c-torture/execute/divconst-1.c: Likewise. * gcc.c-torture/execute/divconst-2.c: Likewise. * gcc.c-torture/execute/divconst-3.c: Likewise. * gcc.c-torture/execute/enum-1.c: Likewise. * gcc.c-torture/execute/enum-2.c: Likewise. * gcc.c-torture/execute/extzvsi.c: Likewise. * gcc.c-torture/execute/frame-address.c: Likewise. * gcc.c-torture/execute/func-ptr-1.c: Likewise. * gcc.c-torture/execute/gofast.c: Likewise. * gcc.c-torture/execute/ieee/20000320-1.c: Likewise. * gcc.c-torture/execute/ieee/20001122-1.c: Likewise. * gcc.c-torture/execute/ieee/20010226-1.c: Likewise. * gcc.c-torture/execute/ieee/20011123-1.c: Likewise. * gcc.c-torture/execute/ieee/920518-1.c: Likewise. * gcc.c-torture/execute/ieee/920810-1.c: Likewise. * gcc.c-torture/execute/ieee/930529-1.c: Likewise. * gcc.c-torture/execute/ieee/980619-1.c: Likewise. * gcc.c-torture/execute/ieee/acc1.c: Likewise. * gcc.c-torture/execute/ieee/acc2.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-1.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-2.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-3.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-4.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-5.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-6.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-8.c: Likewise. * gcc.c-torture/execute/ieee/fp-cmp-9.c: Likewise. * gcc.c-torture/execute/ieee/hugeval.c: Likewise. * gcc.c-torture/execute/ieee/minuszero.c: Likewise. * gcc.c-torture/execute/ieee/mul-subnormal-single-1.c: Likewise. * gcc.c-torture/execute/ieee/mzero2.c: Likewise. * gcc.c-torture/execute/ieee/mzero3.c: Likewise. * gcc.c-torture/execute/ieee/mzero5.c: Likewise. * gcc.c-torture/execute/ieee/mzero6.c: Likewise. * gcc.c-torture/execute/ieee/pr28634.c: Likewise. * gcc.c-torture/execute/ieee/rbug.c: Likewise. * gcc.c-torture/execute/index-1.c: Likewise. * gcc.c-torture/execute/longlong.c: Likewise. * gcc.c-torture/execute/loop-1.c: Likewise. * gcc.c-torture/execute/loop-10.c: Likewise. * gcc.c-torture/execute/loop-11.c: Likewise. * gcc.c-torture/execute/loop-13.c: Likewise. * gcc.c-torture/execute/loop-14.c: Likewise. * gcc.c-torture/execute/loop-15.c: Likewise. * gcc.c-torture/execute/loop-2b.c: Likewise. * gcc.c-torture/execute/loop-2e.c: Likewise. * gcc.c-torture/execute/loop-4.c: Likewise. * gcc.c-torture/execute/loop-4b.c: Likewise. * gcc.c-torture/execute/loop-5.c: Likewise. * gcc.c-torture/execute/loop-6.c: Likewise. * gcc.c-torture/execute/loop-7.c: Likewise. * gcc.c-torture/execute/loop-8.c: Likewise. * gcc.c-torture/execute/memcpy-1.c: Likewise. * gcc.c-torture/execute/memcpy-2.c: Likewise. * gcc.c-torture/execute/memcpy-bi.c: Likewise. * gcc.c-torture/execute/memset-1.c: Likewise. * gcc.c-torture/execute/memset-2.c: Likewise. * gcc.c-torture/execute/memset-3.c: Likewise. * gcc.c-torture/execute/multdi-1.c: Likewise. * gcc.c-torture/execute/multi-ix.c: Likewise. * gcc.c-torture/execute/nest-stdar-1.c: Likewise. * gcc.c-torture/execute/nestfunc-1.c: Likewise. * gcc.c-torture/execute/nestfunc-2.c: Likewise. * gcc.c-torture/execute/nestfunc-3.c: Likewise. * gcc.c-torture/execute/nestfunc-4.c: Likewise. * gcc.c-torture/execute/packed-1.c: Likewise. * gcc.c-torture/execute/pending-4.c: Likewise. * gcc.c-torture/execute/pr15262-1.c: Likewise. * gcc.c-torture/execute/pr15262-2.c: Likewise. * gcc.c-torture/execute/pr15262.c: Likewise. * gcc.c-torture/execute/pr15296.c: Likewise. * gcc.c-torture/execute/pr17252.c: Likewise. * gcc.c-torture/execute/pr17377.c: Likewise. * gcc.c-torture/execute/pr19606.c: Likewise. * gcc.c-torture/execute/pr21964-1.c: Likewise. * gcc.c-torture/execute/pr22061-2.c: Likewise. * gcc.c-torture/execute/pr22061-3.c: Likewise. * gcc.c-torture/execute/pr22061-4.c: Likewise. * gcc.c-torture/execute/pr23467.c: Likewise. * gcc.c-torture/execute/pr27073.c: Likewise. * gcc.c-torture/execute/pr27364.c: Likewise. * gcc.c-torture/execute/pr28403.c: Likewise. * gcc.c-torture/execute/pr31605.c: Likewise. * gcc.c-torture/execute/pr38969.c: Likewise. * gcc.c-torture/execute/pr40657.c: Likewise. * gcc.c-torture/execute/pr44575.c: Likewise. * gcc.c-torture/execute/pr56799.c: Likewise. * gcc.c-torture/execute/pr58640.c: Likewise. * gcc.c-torture/execute/pr71335.c: Likewise. * gcc.c-torture/execute/ptr-arith-1.c: Likewise. * gcc.c-torture/execute/regstack-1.c: Likewise. * gcc.c-torture/execute/scope-1.c: Likewise. * gcc.c-torture/execute/simd-1.c: Likewise. * gcc.c-torture/execute/simd-2.c: Likewise. * gcc.c-torture/execute/simd-4.c: Likewise. * gcc.c-torture/execute/simd-5.c: Likewise. * gcc.c-torture/execute/strcmp-1.c: Likewise. * gcc.c-torture/execute/strcpy-1.c: Likewise. * gcc.c-torture/execute/strct-pack-1.c: Likewise. * gcc.c-torture/execute/strct-pack-2.c: Likewise. * gcc.c-torture/execute/strct-pack-4.c: Likewise. * gcc.c-torture/execute/strct-stdarg-1.c: Likewise. * gcc.c-torture/execute/strct-varg-1.c: Likewise. * gcc.c-torture/execute/strlen-1.c: Likewise. * gcc.c-torture/execute/strncmp-1.c: Likewise. * gcc.c-torture/execute/struct-ini-1.c: Likewise. * gcc.c-torture/execute/struct-ini-2.c: Likewise. * gcc.c-torture/execute/struct-ini-3.c: Likewise. * gcc.c-torture/execute/struct-ini-4.c: Likewise. * gcc.c-torture/execute/struct-ret-1.c: Likewise. * gcc.c-torture/execute/struct-ret-2.c: Likewise. * gcc.c-torture/execute/usmul.c: Likewise. * gcc.c-torture/execute/va-arg-1.c: Likewise. * gcc.c-torture/execute/va-arg-10.c: Likewise. * gcc.c-torture/execute/va-arg-11.c: Likewise. * gcc.c-torture/execute/va-arg-12.c: Likewise. * gcc.c-torture/execute/va-arg-13.c: Likewise. * gcc.c-torture/execute/va-arg-14.c: Likewise. * gcc.c-torture/execute/va-arg-15.c: Likewise. * gcc.c-torture/execute/va-arg-16.c: Likewise. * gcc.c-torture/execute/va-arg-17.c: Likewise. * gcc.c-torture/execute/va-arg-18.c: Likewise. * gcc.c-torture/execute/va-arg-19.c: Likewise. * gcc.c-torture/execute/va-arg-2.c: Likewise. * gcc.c-torture/execute/va-arg-20.c: Likewise. * gcc.c-torture/execute/va-arg-23.c: Likewise. * gcc.c-torture/execute/va-arg-26.c: Likewise. * gcc.c-torture/execute/va-arg-4.c: Likewise. * gcc.c-torture/execute/va-arg-5.c: Likewise. * gcc.c-torture/execute/va-arg-6.c: Likewise. * gcc.c-torture/execute/va-arg-9.c: Likewise. * gcc.c-torture/execute/widechar-1.c: Likewise. * gcc.c-torture/execute/widechar-2.c: Likewise.
2023-11-13C99 testsuite readiness: Compile more tests with -std=gnu89Florian Weimer260-0/+457
gcc/testsuite/ * gcc.c-torture/compile/386.c: Compile with -std=gnu89. * gcc.c-torture/compile/BUG1.c: Likewise. * gcc.c-torture/compile/BUG11.c: Likewise. * gcc.c-torture/compile/BUG16.c: Likewise. * gcc.c-torture/compile/BUG2.c: Likewise. * gcc.c-torture/compile/BUG24.c: Likewise. * gcc.c-torture/compile/BUG25.c: Likewise. * gcc.c-torture/compile/BUG3.c: Likewise. * gcc.c-torture/compile/DFcmp.c: Likewise. * gcc.c-torture/compile/HIcmp.c: Likewise. * gcc.c-torture/compile/HIset.c: Likewise. * gcc.c-torture/compile/QIcmp.c: Likewise. * gcc.c-torture/compile/QIset.c: Likewise. * gcc.c-torture/compile/SFset.c: Likewise. * gcc.c-torture/compile/SIcmp.c: Likewise. * gcc.c-torture/compile/SIset.c: Likewise. * gcc.c-torture/compile/UHIcmp.c: Likewise. * gcc.c-torture/compile/UQIcmp.c: Likewise. * gcc.c-torture/compile/USIcmp.c: Likewise. * gcc.c-torture/compile/a.c: Likewise. * gcc.c-torture/compile/a1.c: Likewise. * gcc.c-torture/compile/a3.c: Likewise. * gcc.c-torture/compile/aa.c: Likewise. * gcc.c-torture/compile/aaa.c: Likewise. * gcc.c-torture/compile/abs.c: Likewise. * gcc.c-torture/compile/ac.c: Likewise. * gcc.c-torture/compile/acc.c: Likewise. * gcc.c-torture/compile/add.c: Likewise. * gcc.c-torture/compile/add386.c: Likewise. * gcc.c-torture/compile/addcc.c: Likewise. * gcc.c-torture/compile/andm.c: Likewise. * gcc.c-torture/compile/andmem.c: Likewise. * gcc.c-torture/compile/andn.c: Likewise. * gcc.c-torture/compile/andok.c: Likewise. * gcc.c-torture/compile/andsi.c: Likewise. * gcc.c-torture/compile/andsparc.c: Likewise. * gcc.c-torture/compile/aos.c: Likewise. * gcc.c-torture/compile/arr.c: Likewise. * gcc.c-torture/compile/as.c: Likewise. * gcc.c-torture/compile/ase.c: Likewise. * gcc.c-torture/compile/band.c: Likewise. * gcc.c-torture/compile/bb0.c: Likewise. * gcc.c-torture/compile/bb1.c: Likewise. * gcc.c-torture/compile/bc.c: Likewise. * gcc.c-torture/compile/bcopy.c: Likewise. * gcc.c-torture/compile/bfx.c: Likewise. * gcc.c-torture/compile/bge.c: Likewise. * gcc.c-torture/compile/bit.c: Likewise. * gcc.c-torture/compile/bitf.c: Likewise. * gcc.c-torture/compile/bitw.c: Likewise. * gcc.c-torture/compile/blk.c: Likewise. * gcc.c-torture/compile/bt386.c: Likewise. * gcc.c-torture/compile/bug.c: Likewise. * gcc.c-torture/compile/buns.c: Likewise. * gcc.c-torture/compile/c.c: Likewise. * gcc.c-torture/compile/c2.c: Likewise. * gcc.c-torture/compile/call.c: Likewise. * gcc.c-torture/compile/callind.c: Likewise. * gcc.c-torture/compile/calls-void.c: Likewise. * gcc.c-torture/compile/calls.c: Likewise. * gcc.c-torture/compile/cc.c: Likewise. * gcc.c-torture/compile/cmb.c: Likewise. * gcc.c-torture/compile/cmpsi386.c: Likewise. * gcc.c-torture/compile/cmul.c: Likewise. * gcc.c-torture/compile/comb.c: Likewise. * gcc.c-torture/compile/consec.c: Likewise. * gcc.c-torture/compile/const.c: Likewise. * gcc.c-torture/compile/conv_tst.c: Likewise. * gcc.c-torture/compile/cvt.c: Likewise. * gcc.c-torture/compile/dbl_parm.c: Likewise. * gcc.c-torture/compile/dblbug.c: Likewise. * gcc.c-torture/compile/dead.c: Likewise. * gcc.c-torture/compile/delay.c: Likewise. * gcc.c-torture/compile/di.c: Likewise. * gcc.c-torture/compile/div.c: Likewise. * gcc.c-torture/compile/dm.c: Likewise. * gcc.c-torture/compile/dshift.c: Likewise. * gcc.c-torture/compile/e.c: Likewise. * gcc.c-torture/compile/ex.c: Likewise. * gcc.c-torture/compile/ext.c: Likewise. * gcc.c-torture/compile/flo.c: Likewise. * gcc.c-torture/compile/forgetcc.c: Likewise. * gcc.c-torture/compile/g.c: Likewise. * gcc.c-torture/compile/gen_tst.c: Likewise. * gcc.c-torture/compile/gronk.c: Likewise. * gcc.c-torture/compile/hi.c: Likewise. * gcc.c-torture/compile/i.c: Likewise. * gcc.c-torture/compile/icmp.c: Likewise. * gcc.c-torture/compile/ifreg.c: Likewise. * gcc.c-torture/compile/jumptab.c: Likewise. * gcc.c-torture/compile/l.c: Likewise. * gcc.c-torture/compile/layout.c: Likewise. * gcc.c-torture/compile/lll.c: Likewise. * gcc.c-torture/compile/load8.c: Likewise. * gcc.c-torture/compile/loadhicc.c: Likewise. * gcc.c-torture/compile/log2.c: Likewise. * gcc.c-torture/compile/logic.c: Likewise. * gcc.c-torture/compile/loop-1.c: Likewise. * gcc.c-torture/compile/loop386.c: Likewise. * gcc.c-torture/compile/lop.c: Likewise. * gcc.c-torture/compile/m1.c: Likewise. * gcc.c-torture/compile/m5.c: Likewise. * gcc.c-torture/compile/m68.c: Likewise. * gcc.c-torture/compile/mbyte.c: Likewise. * gcc.c-torture/compile/mcmp.c: Likewise. * gcc.c-torture/compile/mm.c: Likewise. * gcc.c-torture/compile/mod.c: Likewise. * gcc.c-torture/compile/modcc.c: Likewise. * gcc.c-torture/compile/move.c: Likewise. * gcc.c-torture/compile/move_qhi.c: Likewise. * gcc.c-torture/compile/mregtst.c: Likewise. * gcc.c-torture/compile/mu.c: Likewise. * gcc.c-torture/compile/mword.c: Likewise. * gcc.c-torture/compile/n.c: Likewise. * gcc.c-torture/compile/n1.c: Likewise. * gcc.c-torture/compile/nand.c: Likewise. * gcc.c-torture/compile/neg.c: Likewise. * gcc.c-torture/compile/o.c: Likewise. * gcc.c-torture/compile/omit.c: Likewise. * gcc.c-torture/compile/opout.c: Likewise. * gcc.c-torture/compile/opt.c: Likewise. * gcc.c-torture/compile/or.c: Likewise. * gcc.c-torture/compile/or386.c: Likewise. * gcc.c-torture/compile/p.c: Likewise. * gcc.c-torture/compile/parms.c: Likewise. * gcc.c-torture/compile/pass.c: Likewise. * gcc.c-torture/compile/pp.c: Likewise. * gcc.c-torture/compile/pret-arg.c: Likewise. * gcc.c-torture/compile/pyr.c: Likewise. * gcc.c-torture/compile/pyr2.c: Likewise. * gcc.c-torture/compile/r.c: Likewise. * gcc.c-torture/compile/r1.c: Likewise. * gcc.c-torture/compile/rmsc.c: Likewise. * gcc.c-torture/compile/round.c: Likewise. * gcc.c-torture/compile/sc.c: Likewise. * gcc.c-torture/compile/scal.c: Likewise. * gcc.c-torture/compile/scc.c: Likewise. * gcc.c-torture/compile/scond.c: Likewise. * gcc.c-torture/compile/seq.c: Likewise. * gcc.c-torture/compile/set386.c: Likewise. * gcc.c-torture/compile/set88.c: Likewise. * gcc.c-torture/compile/sh.c: Likewise. * gcc.c-torture/compile/shand.c: Likewise. * gcc.c-torture/compile/shft.c: Likewise. * gcc.c-torture/compile/shift.c: Likewise. * gcc.c-torture/compile/signext.c: Likewise. * gcc.c-torture/compile/signext2.c: Likewise. * gcc.c-torture/compile/simple.c: Likewise. * gcc.c-torture/compile/sparcbug.c: Likewise. * gcc.c-torture/compile/stor.c: Likewise. * gcc.c-torture/compile/str.c: Likewise. * gcc.c-torture/compile/structret.c: Likewise. * gcc.c-torture/compile/sub32.c: Likewise. * gcc.c-torture/compile/subcc.c: Likewise. * gcc.c-torture/compile/subcse.c: Likewise. * gcc.c-torture/compile/sym.c: Likewise. * gcc.c-torture/compile/symconst.c: Likewise. * gcc.c-torture/compile/t.c: Likewise. * gcc.c-torture/compile/test-flow.c: Likewise. * gcc.c-torture/compile/test-loop.c: Likewise. * gcc.c-torture/compile/test.c: Likewise. * gcc.c-torture/compile/tmp.c: Likewise. * gcc.c-torture/compile/trivial.c: Likewise. * gcc.c-torture/compile/trunc.c: Likewise. * gcc.c-torture/compile/u.c: Likewise. * gcc.c-torture/compile/uns.c: Likewise. * gcc.c-torture/compile/uns_tst.c: Likewise. * gcc.c-torture/compile/uuarg.c: Likewise. * gcc.c-torture/compile/volatile-1.c: Likewise. * gcc.c-torture/compile/ww.c: Likewise. * gcc.c-torture/compile/x.c: Likewise. * gcc.c-torture/compile/xb.c: Likewise. * gcc.c-torture/compile/xc.c: Likewise. * gcc.c-torture/compile/xdi.c: Likewise. * gcc.c-torture/compile/xfoo.c: Likewise. * gcc.c-torture/compile/xi.c: Likewise. * gcc.c-torture/compile/xlop.c: Likewise. * gcc.c-torture/compile/xneg.c: Likewise. * gcc.c-torture/compile/xopt.c: Likewise. * gcc.c-torture/compile/xor.c: Likewise. * gcc.c-torture/compile/xorn.c: Likewise. * gcc.c-torture/compile/xp.c: Likewise. * gcc.c-torture/compile/xpp.c: Likewise. * gcc.c-torture/compile/xs.c: Likewise. * gcc.c-torture/compile/xsh.c: Likewise. * gcc.c-torture/compile/xzz.c: Likewise. * gcc.c-torture/compile/zero-strct-1.c: Likewise. * gcc.c-torture/execute/20000717-3.c: Likewise. * gcc.c-torture/execute/920409-1.c: Likewise. * gcc.c-torture/execute/920411-1.c: Likewise. * gcc.c-torture/execute/920415-1.c: Likewise. * gcc.c-torture/execute/920428-1.c: Likewise. * gcc.c-torture/execute/920428-2.c: Likewise. * gcc.c-torture/execute/920429-1.c: Likewise. * gcc.c-torture/execute/920501-1.c: Likewise. * gcc.c-torture/execute/920501-7.c: Likewise. * gcc.c-torture/execute/920501-9.c: Likewise. * gcc.c-torture/execute/920520-1.c: Likewise. * gcc.c-torture/execute/920603-1.c: Likewise. * gcc.c-torture/execute/920721-2.c: Likewise. * gcc.c-torture/execute/920721-3.c: Likewise. * gcc.c-torture/execute/920728-1.c: Likewise. * gcc.c-torture/execute/920730-1.c: Likewise. * gcc.c-torture/execute/920731-1.c: Likewise. * gcc.c-torture/execute/920812-1.c: Likewise. * gcc.c-torture/execute/920909-1.c: Likewise. * gcc.c-torture/execute/921013-1.c: Likewise. * gcc.c-torture/execute/921017-1.c: Likewise. * gcc.c-torture/execute/921123-1.c: Likewise. * gcc.c-torture/execute/921124-1.c: Likewise. * gcc.c-torture/execute/921202-1.c: Likewise. * gcc.c-torture/execute/921207-1.c: Likewise. * gcc.c-torture/execute/921208-2.c: Likewise. * gcc.c-torture/execute/921215-1.c: Likewise. * gcc.c-torture/execute/921218-1.c: Likewise. * gcc.c-torture/execute/921218-2.c: Likewise. * gcc.c-torture/execute/930106-1.c: Likewise. * gcc.c-torture/execute/930429-2.c: Likewise. * gcc.c-torture/execute/930513-1.c: Likewise. * gcc.c-torture/execute/930513-2.c: Likewise. * gcc.c-torture/execute/930518-1.c: Likewise. * gcc.c-torture/execute/930527-1.c: Likewise. * gcc.c-torture/execute/930603-1.c: Likewise. * gcc.c-torture/execute/930603-3.c: Likewise. * gcc.c-torture/execute/930621-1.c: Likewise. * gcc.c-torture/execute/930622-1.c: Likewise. * gcc.c-torture/execute/930630-1.c: Likewise. * gcc.c-torture/execute/930713-1.c: Likewise. * gcc.c-torture/execute/930718-1.c: Likewise. * gcc.c-torture/execute/930719-1.c: Likewise. * gcc.c-torture/execute/930916-1.c: Likewise. * gcc.c-torture/execute/930921-1.c: Likewise. * gcc.c-torture/execute/930929-1.c: Likewise. * gcc.c-torture/execute/930930-1.c: Likewise. * gcc.c-torture/execute/931009-1.c: Likewise. * gcc.c-torture/execute/931012-1.c: Likewise. * gcc.c-torture/execute/931031-1.c: Likewise. * gcc.c-torture/execute/931102-1.c: Likewise. * gcc.c-torture/execute/931102-2.c: Likewise. * gcc.c-torture/execute/931228-1.c: Likewise. * gcc.c-torture/execute/940115-1.c: Likewise. * gcc.c-torture/execute/940122-1.c: Likewise. * gcc.c-torture/execute/941202-1.c: Likewise. * gcc.c-torture/execute/950605-1.c: Likewise. * gcc.c-torture/execute/960830-1.c: Likewise. * gcc.c-torture/execute/961112-1.c: Likewise. * gcc.c-torture/execute/990106-1.c: Likewise. * gcc.c-torture/execute/cmpdi-1.c: Likewise. * gcc.c-torture/execute/comp-goto-2.c: Likewise. * gcc.c-torture/execute/dbra-1.c: Likewise. * gcc.c-torture/execute/inst-check.c: Likewise. * gcc.c-torture/execute/int-compare.c: Likewise. * gcc.c-torture/execute/loop-2.c: Likewise. * gcc.c-torture/execute/loop-2d.c: Likewise. * gcc.c-torture/execute/loop-3.c: Likewise. * gcc.c-torture/execute/loop-3b.c: Likewise. * gcc.c-torture/execute/loop-3c.c: Likewise. * gcc.c-torture/execute/mod-1.c: Likewise. * gcc.c-torture/execute/strct-pack-3.c: Likewise. * gcc.c-torture/execute/tstdi-1.c: Likewise.
2023-11-13C99 testsuite readiness: More unverified testcase un-reductionsFlorian Weimer89-78/+194
gcc/testsuite/ * gcc.c-torture/compile/BUG17.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/BUG18.c (main): Likewise. Call __builtin_printf instead of printf. * gcc.c-torture/compile/BUG21.c (Nase): Add missing void types. * gcc.c-torture/compile/BUG23.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/BUG5.c (bar): Call __builtin_printf instead of printf. * gcc.c-torture/compile/BUG6.c (main): Likewise. Add missing int return type and missing void type. * gcc.c-torture/compile/b.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/b1.c (main): Likewise. Call __builtin_printf instead of printf. * gcc.c-torture/compile/b88.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/bbb.c (flset): Add missing void return type and switch to prototype style. * gcc.c-torture/compile/bf.c (clr, atoi): Declare. (main): Add missing int return type. Call __builtin_printf instead of printf. * gcc.c-torture/compile/bt.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/charmtst.c (foo, bar): Declare. (c_move_tst): Add missing int return type. * gcc.c-torture/compile/cmpdi-1.c (f, g): Add missing int return type. * gcc.c-torture/compile/cmphi.c (foo): Likewise. * gcc.c-torture/compile/conv.c (main): Likewise. Add missing void type. Call __builtin_printf instead of printf. * gcc.c-torture/compile/ddd.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/dilayout.c (str, ll): Add missing void return type. * gcc.c-torture/compile/dimove.c (foo): Likewise. * gcc.c-torture/compile/f2.c (foo): Likewise. * gcc.c-torture/compile/flatten.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/fnul.c (main): Likewise. Call __builtin_printf instead of printf. * gcc.c-torture/compile/fq.c (expand_to_ascii): Add missing void return type. * gcc.c-torture/compile/funcptr-1.c (g): Call __builtin_printf instead of printf. (f): Likewise. Add missing void types. * gcc.c-torture/compile/glob.c (foo): Add missing void types. * gcc.c-torture/compile/goto-1.c (f): Likewise. * gcc.c-torture/compile/i++.c (main): Call __builtin_printf instead of printf. * gcc.c-torture/compile/ic.c (foo): Add missing int return type. * gcc.c-torture/compile/iftrap-1.c (bar, baz): Declare. (f4, f6): Call __builtin_abort instead of abort. * gcc.c-torture/compile/iftrap-2.c (bar): Declare. * gcc.c-torture/compile/jmp.c (foo): Add missing int types. * gcc.c-torture/compile/labels-1.c (f): Add missing int return type and missing void type. Call __builtin_abort instead of abort. * gcc.c-torture/compile/labels-2.c (f): Likewise. * gcc.c-torture/compile/lbug.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/memtst.c (memtst): Add missing void return type. (main): Add missing int return type and missing void type. Call __builtin_bzero instead of bzero. * gcc.c-torture/compile/miscomp.c (main): Add missing int return type and missing void type. Call __builtin_printf instead of printf. * gcc.c-torture/compile/msp.c (bar): Declare. (foo): Add missing void types. * gcc.c-torture/compile/mtst.c (foo): Add missing int return type. * gcc.c-torture/compile/packed-1.c (f): Add missing void types. * gcc.c-torture/compile/pr17119.c (func1, func2): Declare. * gcc.c-torture/compile/pr18712.c (foo, foo1): Declare. * gcc.c-torture/compile/pr20412.c (bar1, bar2, bar3): Declare. * gcc.c-torture/compile/pr21532.c (foo): Declare. * gcc.c-torture/compile/pr22398.c (main): Call __builtin_exit instead of exit. * gcc.c-torture/compile/pr24883.c (orec_str_list): Add missing void return type. * gcc.c-torture/compile/pr25311.c (use): Declare. * gcc.c-torture/compile/pr25514.c (foo): Declare. * gcc.c-torture/compile/pr26425.c (key_put): Declare. * gcc.c-torture/compile/pr27087.c (g): Declare. * gcc.c-torture/compile/pr27282.c (colrow_equal): Add missing int return type. * gcc.c-torture/compile/pr27907.c (fann_run): Add missing void return type. * gcc.c-torture/compile/pr28489.c (c_compile): Likewise. * gcc.c-torture/compile/pr28776-1.c (tree_contains_struct_check_failed): Declare. * gcc.c-torture/compile/pr29128.c (process_main): Add missing void return type. * gcc.c-torture/compile/pr29945.c (unget_char): Declare. (main) Add missing void return type. * gcc.c-torture/compile/pr33382.c (show_configuration): Add missing int types. * gcc.c-torture/compile/pr36141.c (ffi_prep_closure_loc): Add missing return type. * gcc.c-torture/compile/pr36988.c (__writel): Declare. * gcc.c-torture/compile/pr37026.c (foo): Declare. * gcc.c-torture/compile/pr37285.c (_bfd_abort): Declare. (_bfd_xcoff_canonicalize_dynamic_reloc): Add missing void return type. * gcc.c-torture/compile/pr38554.c (applyFunction): Add missing void return type. * gcc.c-torture/compile/pr42164.c (swp_offset, __BUG_ON): Declare. * gcc.c-torture/compile/pr44788.c (foo): Declare. * gcc.c-torture/compile/pr47364-1.c (arc4_init): Add missing void return type. * gcc.c-torture/compile/pr48596.c (_nrrdCenter): Declare. * gcc.c-torture/compile/rel.c (foo): Add missing int return type. * gcc.c-torture/compile/run.c (main): Likewise. Add missing void type. * gcc.c-torture/compile/sar.c (main): Likewise. * gcc.c-torture/compile/selfrec.c (foo): Add missing int parameter type. * gcc.c-torture/compile/shloop.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/shm.c (foo): Add missing int return type. * gcc.c-torture/compile/sim.c (main): Likewise. Add missing void type. * gcc.c-torture/compile/simd-5.c (main): Add missing int return type and missing void type. Call __builtin_printf instead of printf. * gcc.c-torture/compile/sne.c (foo): Add missing int return type. * gcc.c-torture/compile/sound.c (write): Declare. (main): Add missing int return type and missing void type. * gcc.c-torture/compile/speed.c (main): Likewise. * gcc.c-torture/compile/store0.c (foo): Add missing void return type. * gcc.c-torture/compile/storecc.c (foo): Add missing int return type. * gcc.c-torture/compile/strcpy-1.c (rezero): Add missing void types. * gcc.c-torture/compile/stru.c (foo): Add missing void return type. * gcc.c-torture/compile/stuct.c (main): Add missing int return type and missing void type. * gcc.c-torture/compile/time.c (main): Likewise. * gcc.c-torture/compile/unalign-1.c (f): Declare. * gcc.c-torture/compile/v.c (main): Add missing int return type. * gcc.c-torture/compile/xcsebug.c (foo): Add missing void types. * gcc.c-torture/compile/xmtst.c (p2, p3, p4): Add missing int return type. * gcc.c-torture/compile/xz.c (foo): Add missing void return type. * gcc.c-torture/execute/loop-2f.c (f): Add missing void return type. (main): Return instead of calling exit. Call __builtin_abort instead of abort. * gcc.c-torture/execute/loop-2g.c (f): Add missing void return type. (main): Return instead of calling exit. Call __builtin_abort instead of abort. * gcc.dg/20020206-1.c: Build without -w. (main): Call __builtin_abort instead of abort and __builtin_exit instead of exit. * gcc.dg/ipa/20040703-wpa.c (main): Call __builtin_abort instead of abort and __builtin_exit instead of exit. * gcc.dg/torture/pr84528.c (main): Add missing int and void types. Call __builtin_abort instead of abort, and __builtin_exit instead of exit. * gcc.dg/tree-ssa/pr68619-2.c (vector_type_mode, real_inf): Declare. * gcc.dg/tree-ssa/pr68619-3.c (iterative_hash): Declare. (e_hash): Call __builtin_abort instead of abort. * gcc.dg/tree-ssa/pr68619-4.c (rhs_regno, foop, arf): Declare. * gcc.dg/tree-ssa/pr68619-5.c (invert_tree_comparison) (vector_type_mode): Declare. * gcc.dg/tree-ssa/pr69270-2.c (arf, gimple_debug_bind_p) (gimple_bb, gimple_assign_rhs_to_tree) (is_gimple_min_invariant, unshare_expr): Declare. * gcc.dg/tree-ssa/pr69270-3.c: (end_imm_use_stmt_p) (next_imm_use_stmt, arf, boo, update_stmt): Declare. * gcc.dg/tree-ssa/ranger-threader-2.c (gimple_call_arg): Declare. (gimple_op): Call __builtin_abort instead of abort. * gcc.dg/tree-ssa/ranger-threader-3.c (expand_binop): Declare. * gcc.dg/tree-ssa/ssa-dom-branch-1.c (arf, foo): Declare. (try_combine): Add casts to rtx. * gcc.dg/tree-ssa/split-path-3.c (vec_heap_o_reserve) (VEC_int_base_length, bmp_iter_and_compl_init) (bmp_iter_and_compl, bmp_iter_next, VEC_int_heap_free): Declare. * gcc.dg/tree-ssa/split-path-7.c (linit): Call __builtin_strcmp instead of strcmp. * gcc.dg/tree-ssa/ssa-dom-thread-12.c (gimple_call_arg): Declare. (gimple_op): Call __builtin_abort instead of abort. * gcc.dg/tree-ssa/ssa-dom-thread-13.c (arf, error): Declare. (convert): Call __builtin_abort instead of abort. * gcc.dg/tree-ssa/ssa-dom-thread-14.c (exand_binop): Declare. * gcc.dg/tree-ssa/ssa-dom-thread-15.c (ix86_target_stack_probe, pro_epilogue_adjust_stack) (gen_rtx_CONST_INT, fancy_abort): Declare. * gcc.dg/tree-ssa/ssa-dse-25.c (foo): Call __builtin_memset instead of memset. * gcc.target/aarch64/aapcs64/va_arg-17.c (init_data): Call __builtin_memset instead of memset. * gcc.target/i386/pr69030.c (fn1): Call __builtin_printf instead of printf.
2023-11-13C99 testsuite readiness: Verified un-reductionsFlorian Weimer36-28/+82
* gcc.c-torture/compile/20080613-1.c (hop_sendmsg): Call __builtin_memcpy instead of memcpy. * gcc.c-torture/compile/complex-6.c (bar): Declare. * gcc.c-torture/compile/pr23445.c (__brelse): Declare. * gcc.c-torture/compile/pr23946.c (long2str): Declare. (avi_parse_comments): Call __builtin_memset instead of memset. __builtin_malloc instead of malloc. Call __builtin_memcpy instead of memcpy. Call __builtin_free instead of free. * gcc.c-torture/compile/pr31953.c (toggle_hexedit_mode): Add missing void return type. * gcc.c-torture/compile/pr32372.c (MPV_encode_init): Add missing void return type. * gcc.c-torture/compile/pr32355.c (sigemptyset): Declare. (doSignalsSetup): Add missing void return type. * gcc.c-torture/compile/pr32453.c (__assert_fail): Declare. * gcc.c-torture/compile/pr32571.c (mthca_is_memfree) (mthca_arbel_fmr_unmap, mthca_tavor_fmr_unmap) (mthca_unmap_fmr): Declare. * gcc.c-torture/compile/pr32584.c (sortpin): Add missing void types. * gcc.c-torture/compile/pr32919.c (read_int, _itoa_word) (__strnlen): Declare. * gcc.c-torture/compile/pr33173.c (test_dir_format): Add missing void return type. Add missing int types. * gcc.c-torture/compile/pr33855.c (cabsl): Declare. * gcc.c-torture/compile/pr34334.c (__strsep_1c) (__strsep_2c): Add missing void return type. * gcc.c-torture/compile/pr35006.c (grub_putchar) (cl_set_pos, cl_print, grub_memmove, cl_delete): Declare. (grub_cmdline_get): Add missing void return type. * gcc.c-torture/compile/pr35595.c (__kernel_sinf): Declare. * gcc.c-torture/compile/pr35869.c (f): Add missing void return type. * gcc.c-torture/compile/pr36172.c (FcCharSetFreeze): Add missing return value. * gcc.c-torture/compile/pr36238.c (lshift_s_s): Declare. * gcc.c-torture/compile/pr37207.c (func_81, func_98): Declare. * gcc.c-torture/compile/pr37258.c (mod_rhs, lshift_s_s) (func_112, func_23): Declare. * gcc.c-torture/compile/pr37305.c (safe_mod_u_u): Declare. * gcc.c-torture/compile/pr37327.c (func_93, func_59) (func_124, func_117, safe_add_uint64_t_u_u) (safe_mul_int32_t_s_s): Declare. * gcc.c-torture/compile/pr37387.c (FuncMakeConsequencesPres): Call __builtin_abort instead of ErrorQuit. * gcc.c-torture/compile/pr37432.c (print_wkb_bytes): Declare. * gcc.c-torture/compile/pr37713.c (sdp_seq_alloc): Declare. * gcc.c-torture/compile/pr39886.c (func): Declare. * gcc.c-torture/compile/pr39941.c (stop): Declare. * gcc.c-torture/compile/pr41016.c (CompareRNAStructures): Call __builtin_abort instead of Die. * gcc.c-torture/compile/pr42632.c (___pskb_trim): Add forward declaration. * gcc.c-torture/compile/pr49710.c (baz): Add forward declaration and missing void types. (bar): Add missing void type. * gcc.c-torture/compile/pr52437.c (fn2): Declare. * gcc.c-torture/compile/pr57441.c (func_1): Add missing void return type. * gcc.c-torture/compile/pr87110.c (struct d): Add missing semicolon. (g, h): Define as int. (i): Add missing void types. * gcc.c-torture/compile/pr87468.c (a): Define as int. (e, f): Declare. (b): Add missing void types. * gcc.c-torture/execute/pr79043.c (ptr2): Use cast in initializer. (typepun): Add missing void return type. (main): Add missing int return type and missing void type. * gcc.dg/pr100349.c (b): Add missing void return type. * gcc.dg/pr106189.c (T): Declare. * gcc.dg/pr110777.c (_setjmp): Declare * gcc.dg/pr45506.c (dynvec, relative_relocp, atexit): Declare. (fini_array): Cast result of relative_relocp from int to int *. * gcc.dg/pr97359.c: Compile with -Wno-pointer-to-int-cast. (b): Cast point to int to avoid int-conversion warning. * gcc.dg/uninit-pr78548.c: Call __builtin_printf instead of printf. * gcc.dg/torture/pr39829.c (f): Declare. * gcc.dg/torture/pr44977.c (int329): Cast bar from pointer to short. * gcc.dg/torture/pr53703.c (ifa_sa_len): Declare. (usagi_getifaddrs): Call __builtin_memset instead of memset and __builtin_memcmp instead of memcmp. * gcc.dg/torture/pr68625.c (z9): Explicitly cast pointers to int. * gcc.dg/torture/pr55964.c (f): Cast q to the expected type. * gcc.dg/torture/pr70623.c (h9): Fix pointer cast in assignment of av. * gcc.dg/torture/pr81118.c (c): Return zero instead of nothing. * gcc.dg/torture/pr81510.c (e): Add cast from int to pointer. * gcc.dg/torture/pr99694.c (d): Add missing casts between pointers and integers. * gcc.dg/tree-ssa/pr102563.c: Define as void (*) (void). (_bdf_parse_glyphs_p): Define with prototype. * gcc.dg/tree-ssa/pr92085-1.c (di): Add cast to initialization of fq. * gcc.dg/tree-ssa/pr92085-2.c (c1): Add casts to initializations of th, lq. * gcc.dg/tree-ssa/reassoc-43.c (c_parser_next_token_is_keyword, chainon) (c_parser_attributes): Declare. * gcc.dg/tree-ssa/split-path-4.c (powi_lookup_cost): Declare. (powi_cost): Add missing void return type. * gcc.dg/tree-ssa/split-path-6.c (strtosichar) (ichartosstr, treeinsert, stop, __srget_r): Declare (givehelp, oof, lookharder): Convert to prototypes. * gcc.target/i386/pr71621-1.c (y8): Cast to expected pointer type in assignment of t6. * gcc.target/i386/pr79571.c (g): Add missing int type. (j): Add missing void types and pointer cast. * gcc.target/i386/pr87246.c (s2): Add cast from integer to pointer type. * gcc.target/i386/pr87759.c (rc): Cast to the expected pointer time in initialization of ar. * gcc.target/i386/pr99454.c (tg3_start_xmit): Add missing cast from int to int *.
2023-11-13C99 testsuite readiness: -fpermissive testsFlorian Weimer77-1/+115
These tests use obsolete language constructs, but they are not clearly targeting C89, either. So use -fpermissive to keep future errors as warnings. The reasons why obsolete constructs are used used vary from test to test. Some tests deliberately exercise later stages of the compiler that only occur with those constructs. Some tests have precise expectations about warnings that will become errors with a future change, but do not specifically test a particular warning/error (if that is the case, the later changes tend to duplicate them into warning/error variants). In a few cases, use of obsolete constructs is clearly due to test case reduction, but it was not possible to un-reduce the test due to its size. gcc/testsuite/ * c-c++-common/Wduplicated-branches-11.c: Compile with -fpermissive. * c-c++-common/Wduplicated-branches-12.c: Likewise. * c-c++-common/builtins.c: Likewise. * c-c++-common/pointer-to-fn1.c: Likewise. * gcc.c-torture/compile/20010320-1.c: Likewise. * gcc.c-torture/compile/20050105-1.c: Likewise. * gcc.c-torture/compile/20080704-1.c: Likewise. * gcc.c-torture/compile/20080910-1.c: Likewise. * gcc.c-torture/compile/20090917-1.c: Likewise. * gcc.c-torture/compile/20100915-1.c: Likewise. * gcc.c-torture/compile/20101216-1.c: Likewise. * gcc.c-torture/compile/20121027-1.c: Likewise. * gcc.c-torture/compile/20180605-1.c: Likewise. * gcc.c-torture/compile/950816-2.c: Likewise. * gcc.c-torture/compile/dse.c: Likewise. * gcc.c-torture/compile/pr100576.c: Likewise. * gcc.c-torture/compile/pr17408.c: Likewise. * gcc.c-torture/compile/pr19121.c: Likewise. * gcc.c-torture/compile/pr26213.c: Likewise. * gcc.c-torture/compile/pr27341-2.c: Likewise. * gcc.c-torture/compile/pr28776-2.c: Likewise. * gcc.c-torture/compile/pr33133.c: Likewise. * gcc.c-torture/compile/pr34091.c: Likewise. * gcc.c-torture/compile/pr36154.c: Likewise. * gcc.c-torture/compile/pr37381.c: Likewise. * gcc.c-torture/compile/pr38360.c: Likewise. * gcc.c-torture/compile/pr40291.c: Likewise. * gcc.c-torture/compile/pr41182-1.c: Likewise. * gcc.c-torture/compile/pr43635.c: Likewise. * gcc.c-torture/compile/pr44043.c: Likewise. * gcc.c-torture/compile/pr44063.c: Likewise. * gcc.c-torture/compile/pr44246.c: Likewise. * gcc.c-torture/compile/pr45535.c: Likewise. * gcc.c-torture/compile/pr46934.c: Likewise. * gcc.c-torture/compile/pr47428.c: Likewise. * gcc.c-torture/compile/pr49145.c: Likewise. * gcc.c-torture/compile/pr49206.c: Likewise. * gcc.c-torture/compile/pr51694.c: Likewise. * gcc.c-torture/compile/pr53886.c: Likewise. * gcc.c-torture/compile/pr65241.c: Likewise. * gcc.c-torture/compile/pr72802.c: Likewise. * gcc.c-torture/compile/pr81360.c: Likewise. * gcc.c-torture/compile/pr82052.c: Likewise. * gcc.c-torture/compile/pr90275-2.c: Likewise. * gcc.c-torture/compile/pr90275.c: Likewise. * gcc.c-torture/compile/pr96796.c: Likewise. * gcc.c-torture/compile/regs-arg-size.c: Likewise. * gcc.c-torture/compile/udivmod4.c: Likewise. * gcc.c-torture/compile/widechar-1.c: Likewise. * gcc.c-torture/execute/20000412-3.c: Likewise. * gcc.c-torture/execute/20010605-2.c: Likewise. * gcc.c-torture/execute/20020314-1.c: Likewise. * gcc.c-torture/execute/20020819-1.c: Likewise. * gcc.c-torture/execute/20031211-2.c: Likewise. * gcc.c-torture/execute/20040223-1.c: Likewise. * gcc.c-torture/execute/20041019-1.c: Likewise. * gcc.c-torture/execute/20120427-1.c: Likewise. * gcc.c-torture/execute/20120427-2.c: Likewise. * gcc.c-torture/execute/920908-2.c: Likewise. * gcc.c-torture/execute/921110-1.c: Likewise. * gcc.c-torture/execute/930111-1.c: Likewise. * gcc.c-torture/execute/930208-1.c: Likewise. * gcc.c-torture/execute/930702-1.c: Likewise. * gcc.c-torture/execute/930818-1.c: Likewise. * gcc.c-torture/execute/931017-1.c: Likewise. * gcc.c-torture/execute/931018-1.c: Likewise. * gcc.c-torture/execute/931208-1.c: Likewise. * gcc.c-torture/execute/941101-1.c: Likewise. * gcc.c-torture/execute/941110-1.c: Likewise. * gcc.c-torture/execute/950322-1.c: Likewise. * gcc.c-torture/execute/950426-1.c: Likewise. * gcc.c-torture/execute/950512-1.c: Likewise. * gcc.c-torture/execute/950621-1.c: Likewise. * gcc.c-torture/execute/960218-1.c: Likewise. * gcc.c-torture/execute/960402-1.c: Likewise. * gcc.c-torture/execute/cmpsf-1.c: Likewise. * gcc.c-torture/execute/cmpsi-1.c: Likewise. * gcc.c-torture/execute/cmpsi-2.c: Likewise. * gcc.c-torture/execute/divmod-1.c: Likewise. * gcc.c-torture/execute/pr22061-1.c: Likewise. * gcc.c-torture/execute/pr55875.c: Likewise. * gcc.dg/20050629-1.c: Likewise. * gcc.dg/20080615-1.c: Likewise. * gcc.dg/Walloca-14.c: Likewise. * gcc.dg/Wbuiltin-declaration-mismatch-3.c: Likewise. * gcc.dg/Wbuiltin-declaration-mismatch-9.c: Likewise. * gcc.dg/Wdouble-promotion.c: Likewise. * gcc.dg/Wrestrict-5.c: Likewise. * gcc.dg/Wstringop-overflow-13.c: Likewise. * gcc.dg/analyzer/fd-bind-pr107783.c: Likewise. * gcc.dg/array-5.c: Likewise. * gcc.dg/asan/pr56417.c: Likewise. * gcc.dg/attr-access-read-only.c: Likewise. * gcc.dg/attr-access-read-write.c: Likewise. * gcc.dg/attr-access-write-only.c: Likewise. * gcc.dg/bitint-36.c: Likewise. * gcc.dg/builtin-bswap-10.c: Likewise. * gcc.dg/cleanup-1.c: Likewise. * gcc.dg/cpp/pr60014-1.c: Likewise. * gcc.dg/cpp/pr60014-2.c: Likewise. * gcc.dg/cpp/pr60014-3.c: Likewise. * gcc.dg/ipa/ipa-bit-cp-1.c: Likewise. * gcc.dg/ipa/ipa-bit-cp-2.c: Likewise. * gcc.dg/ipa/ipa-bit-cp.c: Likewise. * gcc.dg/ipa/pr105639.c: Likewise. * gcc.dg/ipa/pr71981.c: Likewise. * gcc.dg/lto/20081109_0.c: Likewise. * gcc.dg/lto/pr54702_1.c: Likewise. * gcc.dg/lto/pr55525_0.c: Likewise. * gcc.dg/noncompile/20020213-1.c:: Likewise. * gcc.dg/noncompile/pr71426.c: Likewise. * gcc.dg/noncompile/undeclared-1.c: Likewise. * gcc.dg/overflow-warn-2.c: Likewise. * gcc.dg/pr100142.c: Likewise. * gcc.dg/pr100790.c: Likewise. * gcc.dg/pr100791.c: Likewise. * gcc.dg/pr103093.c: Likewise. * gcc.dg/pr105140.c: Likewise. * gcc.dg/pr105250.c: Likewise. * gcc.dg/pr105853.c: Likewise. * gcc.dg/pr105856.c: Likewise. * gcc.dg/pr26865.c: Likewise. * gcc.dg/pr40989.c: Likewise. * gcc.dg/pr42715.c: Likewise. * gcc.dg/pr44971.c: Likewise. * gcc.dg/pr46571.c: Likewise. * gcc.dg/pr54363.c: Likewise. * gcc.dg/pr56724-2.c: Likewise. * gcc.dg/pr59630.c: Likewise. * gcc.dg/pr67043.c: Likewise. * gcc.dg/pr67730-1.c: Likewise. * gcc.dg/pr67730-2.c: Likewise. * gcc.dg/pr68320.c: Likewise. * gcc.dg/pr69156.c: Likewise. * gcc.dg/pr69824.c: Likewise. * gcc.dg/pr70174.c: Likewise. * gcc.dg/pr70281.c: Likewise. * gcc.dg/pr77862.c: Likewise. * gcc.dg/pr82765.c: Likewise. * gcc.dg/pr83852.c: Likewise. * gcc.dg/pr84206.c: Likewise. * gcc.dg/pr85164-1.c: Likewise. * gcc.dg/pr85955.c: Likewise. * gcc.dg/pr86271.c: Likewise. * gcc.dg/pr86928.c: Likewise. * gcc.dg/pr99122-1.c: Likewise. * gcc.dg/pr99136.c: Likewise. * gcc.dg/redecl-19.c: Likewise. * gcc.dg/redecl-24.c: Likewise. * gcc.dg/torture/pr39204.c: Likewise. * gcc.dg/torture/pr57676.c: Likewise. * gcc.dg/torture/pr67222.c: Likewise. * gcc.dg/torture/pr77677-2.c: Likewise. * gcc.dg/torture/pr79125.c: Likewise. * gcc.dg/torture/pr94479.c: Likewise. * gcc.dg/tree-ssa/20070815.c: Likewise. * gcc.dg/tree-ssa/builtin-sprintf-29.c: Likewise. * gcc.dg/tree-ssa/builtins-folding-gimple-ub.c: Likewise. * gcc.dg/tree-ssa/pr22051-2.c: Likewise. * gcc.dg/tree-ssa/ssa-dse-10.c: Likewise. * gcc.target/aarch64/pr60697.c: Likewise. * gcc.target/aarch64/pr87305.c: Likewise. * gcc.target/aarch64/sve/pr96357.c: Likewise. * gcc.target/i386/attr-nocf-check-1a.c: Likewise. * gcc.target/i386/attr-nocf-check-3a.c: Likewise. * gcc.target/i386/avx512bf16-pr108881.c: Likewise. * gcc.target/i386/cet-notrack-2a.c: Likewise. * gcc.target/i386/cet-notrack-2b.c: Likewise. * gcc.target/i386/cet-notrack-5b.c: Likewise. * gcc.target/i386/cet-notrack-6a.c: Likewise. * gcc.target/i386/cet-notrack-6b.c: Likewise. * gcc.target/i386/pr70325.c: Likewise. * gcc.target/i386/pr70858.c: Likewise. * gcc.target/i386/pr83488.c: Likewise. * gcc.target/i386/pr85511.c: Likewise. * gcc.target/i386/pr87572.c: Likewise. * gcc.target/i386/pr88195.c: Likewise.
2023-11-06C99 testsuite readiness: Some unverified test case un-reductionsFlorian Weimer112-83/+174
gcc/testsuite/ * gcc.c-torture/compile/20000412-2.c (f): Call __builtin_strlen instead of strlen. * gcc.c-torture/compile/20000427-1.c (FindNearestPowerOf2): Declare. * gcc.c-torture/compile/20000802-1.c (bar): Call __builtin_memcpy instead of memcpy. * gcc.c-torture/compile/20010525-1.c (kind_varread): Likewise. * gcc.c-torture/compile/20010706-1.c (foo): Add missing int return type. * gcc.c-torture/compile/20020314-1.c (add_output_space_event) (del_tux_atom, add_req_to_workqueue): Declare. * gcc.c-torture/compile/20020701-1.c (f): Call __builtin_memcpy instead of memcpy. * gcc.c-torture/compile/20021015-2.c (f): Call __builtin_bcmp instead of bcmo. * gcc.c-torture/compile/20030110-1.c (inb): Declare. * gcc.c-torture/compile/20030314-1.c (bar): Add missing void return type. * gcc.c-torture/compile/20030405-1.c (bar): Add missing int return type. * gcc.c-torture/compile/20030416-1.c (bar): Declare. (main): Add missing int return type. * gcc.c-torture/compile/20030503-1.c (bar): Declare. * gcc.c-torture/compile/20030530-1.c: (bar): Declare. * gcc.c-torture/compile/20031031-2.c (foo, bar, baz): Declare. * gcc.c-torture/compile/20040101-1.c (test16): Call __builtin_printf instead of printf. * gcc.c-torture/compile/20040124-1.c (f2, f3): Declare. * gcc.c-torture/compile/20040304-1.c (macarg): Declare. * gcc.c-torture/compile/20040705-1.c (f): Call __builtin_memcpy instead of memcpy. * gcc.c-torture/compile/20040908-1.c (bar): Declare. * gcc.c-torture/compile/20050510-1.c (dont_remove): Declare. * gcc.c-torture/compile/20051228-1.c (bar): Declare. * gcc.c-torture/compile/20060109-1.c (cpp_interpret_string): Declare. (int_c_lex, cb_ident): Add missing void return type. (cb_ident): Define as static. * gcc.c-torture/compile/20060202-1.c (sarray_get): Declare. * gcc.c-torture/compile/20070129.c (regcurly) (reguni): Declare. * gcc.c-torture/compile/20070529-1.c (__fswab16): Declare. * gcc.c-torture/compile/20070529-2.c (kmem_free): Declare. * gcc.c-torture/compile/20070605-1.c (quantize_fs_dither): Add missing void return type. * gcc.c-torture/compile/20071107-1.c (settings_install_property_parser): Declare. * gcc.c-torture/compile/20090907-1.c (load_waveform): Call __builtin_abort instead of abort. * gcc.c-torture/compile/20100907.c (t): Add missing void types. * gcc.c-torture/compile/20120524-1.c (build_packet): Call __builtin_memcpy instead of memcpy. * gcc.c-torture/compile/20120830-2.c (ubidi_writeReordered_49): Add missing void return type. * gcc.c-torture/compile/20121010-1.c (read_long): Add missing int return type. * gcc.c-torture/compile/920301-1.c (f, g): Add missing void types. * gcc.c-torture/compile/920409-1.c (x): Likewise. * gcc.c-torture/compile/920410-1.c (main): Add missing int return type. Call __builtin_printf instead of printf. * gcc.c-torture/compile/920410-2.c (joe): Add missing void types. * gcc.c-torture/compile/920411-2.c (x): Likewise. * gcc.c-torture/compile/920413-1.c (f): Add missing int return type. * gcc.c-torture/compile/920428-3.c (x): Add missing int types. * gcc.c-torture/compile/920428-4.c (x): Add missing void return type and int parameter type. * gcc.c-torture/compile/920501-10.c (x): Add missing int types. * gcc.c-torture/compile/920501-12.c (x, a, b, A, B): Likewise. * gcc.c-torture/compile/920501-17.c (x): Add missing void types. * gcc.c-torture/compile/920501-19.c (y): Likewise. * gcc.c-torture/compile/920501-22.c (x): Likewise. * gcc.c-torture/compile/920501-3.c (x): Likewise. * gcc.c-torture/compile/920501-4.c (foo): Likewise. * gcc.c-torture/compile/920529-1.c (f): Call __builtin_abort instead of abort. * gcc.c-torture/compile/920615-1.c (f): Add missing void types. * gcc.c-torture/compile/920623-1.c (g): Likewise. * gcc.c-torture/compile/920624-1.c (f): Likewise. * gcc.c-torture/compile/920711-1.c (f): Add missing int types. * gcc.c-torture/compile/920729-1.c (f): Add missing void types. * gcc.c-torture/compile/920806-1.c (f): Likewise. * gcc.c-torture/compile/920821-2.c (f): Likewise. * gcc.c-torture/compile/920825-1.c (f): Likewise. * gcc.c-torture/compile/920825-2.c (f, g): Add missing void return type. * gcc.c-torture/compile/920826-1.c (f): Likewise. * gcc.c-torture/compile/920828-1.c (f): Add missing int types. * gcc.c-torture/compile/920829-1.c (f): Add missing void return type. * gcc.c-torture/compile/920928-3.c (f): Likewise. * gcc.c-torture/compile/921012-2.c (f): Likewise. * gcc.c-torture/compile/921013-1.c (f): Likewise. * gcc.c-torture/compile/921019-1.c (f): Add missing void types. * gcc.c-torture/compile/921026-1.c (f): Add missing void return type. * gcc.c-torture/compile/921126-1.c (f): Add missing int return type and missing void. * gcc.c-torture/compile/921227-1.c (f): Add missing void types. * gcc.c-torture/compile/930109-2.c (f): Add missing int types. * gcc.c-torture/compile/930210-1.c (f): Add missing void types. * gcc.c-torture/compile/930222-1.c (g): Declare. (f): Add missing int return type. * gcc.c-torture/compile/930421-1.c (f): Add missing void return type. * gcc.c-torture/compile/930503-1.c (f): Likewise. * gcc.c-torture/compile/930513-1.c (f): Add missing int return type. * gcc.c-torture/compile/930513-3.c (test): Add missing void types. * gcc.c-torture/compile/930523-1.c (f): Likewise. * gcc.c-torture/compile/930527-1.c (f): Likewise. * gcc.c-torture/compile/930603-1.c (f): Likewise. * gcc.c-torture/compile/930607-1.c (g): Likewise. * gcc.c-torture/compile/930702-1.c (f): Add missing int return type and missing void. * gcc.c-torture/compile/931018-1.c (f): Add missing void return type. * gcc.c-torture/compile/931031-1.c (f): Likewise. * gcc.c-torture/compile/931102-1.c (xxx): Add missing void types. * gcc.c-torture/compile/940611-1.c (f): Likewise. * gcc.c-torture/compile/940712-1.c (f): Add missing int return type and missing void. * gcc.c-torture/compile/950512-1.c (g): Declare. (f): Add missing void return type. * gcc.c-torture/compile/950530-1.c (f): Add missing int return type. * gcc.c-torture/compile/950610-1.c (f): Add missing void return type. * gcc.c-torture/compile/950613-1.c (f): Add missing void types. * gcc.c-torture/compile/950816-1.c (f): Add missing int return type and missing void. * gcc.c-torture/compile/950816-2.c (func): Declare. (f): Add missing void types. * gcc.c-torture/compile/950816-3.c (f): Add missing int return type and missing void. * gcc.c-torture/compile/950919-1.c (f): Add missing void types. * gcc.c-torture/compile/950921-1.c (f): Add missing int return type and missing void. * gcc.c-torture/compile/951004-1.c (f): Add missing void return type. * gcc.c-torture/compile/951116-1.c (f): Add missing int return type and missing void. * gcc.c-torture/compile/951128-1.c (f): Add missing void return type. * gcc.c-torture/compile/951220-1.c (f): Add missing int return type. * gcc.c-torture/compile/960220-1.c (f): Add missing void types. * gcc.c-torture/compile/960221-1.c (foo): Add missing void return type. * gcc.c-torture/compile/960704-1.c (main): Add missing int return type and missing void. * gcc.c-torture/compile/961031-1.c (f): Add missing void types. * gcc.c-torture/compile/961126-1.c (sub, sub2): Declare. (main): Add missing int return type and missing void. * gcc.c-torture/compile/961203-1.c (main): Call __builtin_exit instead of exit. * gcc.c-torture/compile/981001-1.c (main): Likewise. * gcc.c-torture/compile/981107-1.c (call): Declare. * gcc.c-torture/compile/990517-1.c (sdbm__splpage): Call __builtin_memcpy instead of memcpy. * gcc.c-torture/compile/990617-1.c (main): Call __builtin_printf instead of printf. * gcc.c-torture/compile/991026-2.c (detach): Add missing void types. * gcc.c-torture/compile/991229-1.c (ejEval): Likewise. * gcc.c-torture/compile/991229-3.c (rand): Declare.
2023-11-06gcc.c-torture/execute/builtins/fputs.c: fputs_unlocked prototypeFlorian Weimer1-0/+4
Current glibc headers only declare fputs_unlocked for _GNU_SOURCE, so define it to obtain an official prototype. Add a fallback prototype declaration for other systems that do not have fputs_unlocked. This seems to the most straightforward approach to avoid an implicit function declaration, without reducing test coverage and introducing ongoing maintenance requirements (e.g., FreeBSD added fputs_unlocked support fairly recently). gcc/testsuite/ * gcc.c-torture/execute/builtins/fputs.c (_GNU_SOURCE): Define. (fputs_unlocked): Declare.
2023-10-24match: Fix the `popcnt(a&b) + popcnt(a|b)` pattern for types [PR111913]Andrew Pinski1-0/+13
So this pattern needs a little help on the gimple side of things to know what the type popcount should be. For most builtins, the type is the same as the input but popcount and others are not. And when using it with another outer expression, genmatch needs some slight help to know that the return type was type rather than the argument type. Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/111913 gcc/ChangeLog: * match.pd (`popcount(X&Y) + popcount(X|Y)`): Add the resulting type for popcount. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/fold-popcount-1.c: New test. * gcc.dg/fold-popcount-8a.c: New test.
2023-10-23gcc.c-torture/execute/builtins/pr93262-chk.c: Remove return statementFlorian Weimer1-1/+0
The main_test function returns void, so return with an expression is a constraint violation. The test case still fails with this change applied before the fix for PR 93262 in r14-4813. gcc/testsuite/ * gcc.c-torture/execute/builtins/pr93262-chk.c (main_test): Remove unnecessary return statement.
2023-10-21C99 testsuite readiness: Compile more tests with -std=gnu89Florian Weimer112-0/+195
gcc/testsuite/ * gcc.c-torture/compile/20000403-1.c: Compile with -std=gnu89. * gcc.c-torture/compile/20000511-1.c: Likewise. * gcc.c-torture/compile/20000804-1.c: Likewise. * gcc.c-torture/compile/20020418-1.c: Likewise. * gcc.c-torture/compile/20020927-1.c: Likewise. * gcc.c-torture/compile/20030109-1.c: Likewise. * gcc.c-torture/compile/20030224-1.c: Likewise. * gcc.c-torture/compile/20030415-1.c: Likewise. * gcc.c-torture/compile/20030612-1.c: Likewise. * gcc.c-torture/compile/20030917-1.c: Likewise. * gcc.c-torture/compile/20031113-1.c: Likewise. * gcc.c-torture/compile/20031220-2.c: Likewise. * gcc.c-torture/compile/20040309-1.c: Likewise. * gcc.c-torture/compile/20040310-1.c: Likewise. * gcc.c-torture/compile/20040317-3.c: Likewise. * gcc.c-torture/compile/20040817-1.c: Likewise. * gcc.c-torture/compile/20091215-1.c: Likewise. * gcc.c-torture/compile/86.c: Likewise. * gcc.c-torture/compile/900216-1.c: Likewise. * gcc.c-torture/compile/900313-1.c: Likewise. * gcc.c-torture/compile/900407-1.c: Likewise. * gcc.c-torture/compile/900516-1.c: Likewise. * gcc.c-torture/compile/920409-2.c: Likewise. * gcc.c-torture/compile/920415-1.c: Likewise. * gcc.c-torture/compile/920428-1.c: Likewise. * gcc.c-torture/compile/920428-5.c: Likewise. * gcc.c-torture/compile/920428-7.c: Likewise. * gcc.c-torture/compile/920501-1.c: Likewise. * gcc.c-torture/compile/920501-13.c: Likewise. * gcc.c-torture/compile/920501-15.c: Likewise. * gcc.c-torture/compile/920501-16.c: Likewise. * gcc.c-torture/compile/920501-18.c: Likewise. * gcc.c-torture/compile/920501-20.c: Likewise. * gcc.c-torture/compile/920501-6.c: Likewise. * gcc.c-torture/compile/920501-7.c: Likewise. * gcc.c-torture/compile/920502-1.c: Likewise. * gcc.c-torture/compile/920502-2.c: Likewise. * gcc.c-torture/compile/920520-1.c: Likewise. * gcc.c-torture/compile/920521-1.c: Likewise. * gcc.c-torture/compile/920608-1.c: Likewise. * gcc.c-torture/compile/920617-1.c: Likewise. * gcc.c-torture/compile/920617-2.c: Likewise. * gcc.c-torture/compile/920625-1.c: Likewise. * gcc.c-torture/compile/920625-2.c: Likewise. * gcc.c-torture/compile/920626-1.c: Likewise. * gcc.c-torture/compile/920706-1.c: Likewise. * gcc.c-torture/compile/920710-2.c: Likewise. * gcc.c-torture/compile/920723-1.c: Likewise. * gcc.c-torture/compile/920808-1.c: Likewise. * gcc.c-torture/compile/920809-1.c: Likewise. * gcc.c-torture/compile/920817-1.c: Likewise. * gcc.c-torture/compile/920831-1.c: Likewise. * gcc.c-torture/compile/920917-1.c: Likewise. * gcc.c-torture/compile/920928-2.c: Likewise. * gcc.c-torture/compile/920928-5.c: Likewise. * gcc.c-torture/compile/921012-1.c: Likewise. * gcc.c-torture/compile/921021-1.c: Likewise. * gcc.c-torture/compile/921024-1.c: Likewise. * gcc.c-torture/compile/921103-1.c: Likewise. * gcc.c-torture/compile/921109-1.c: Likewise. * gcc.c-torture/compile/921111-1.c: Likewise. * gcc.c-torture/compile/921116-2.c: Likewise. * gcc.c-torture/compile/921118-1.c: Likewise. * gcc.c-torture/compile/921202-1.c: Likewise. * gcc.c-torture/compile/921202-2.c: Likewise. * gcc.c-torture/compile/921203-1.c: Likewise. * gcc.c-torture/compile/921203-2.c: Likewise. * gcc.c-torture/compile/921206-1.c: Likewise. * gcc.c-torture/compile/930109-1.c: Likewise. * gcc.c-torture/compile/930111-1.c: Likewise. * gcc.c-torture/compile/930117-1.c: Likewise. * gcc.c-torture/compile/930118-1.c: Likewise. * gcc.c-torture/compile/930120-1.c: Likewise. * gcc.c-torture/compile/930217-1.c: Likewise. * gcc.c-torture/compile/930325-1.c: Likewise. * gcc.c-torture/compile/930411-1.c: Likewise. * gcc.c-torture/compile/930427-2.c: Likewise. * gcc.c-torture/compile/930503-2.c: Likewise. * gcc.c-torture/compile/930506-2.c: Likewise. * gcc.c-torture/compile/930513-2.c: Likewise. * gcc.c-torture/compile/930530-1.c: Likewise. * gcc.c-torture/compile/930602-1.c: Likewise. * gcc.c-torture/compile/930618-1.c: Likewise. * gcc.c-torture/compile/930623-1.c: Likewise. * gcc.c-torture/compile/931003-1.c: Likewise. * gcc.c-torture/compile/931013-1.c: Likewise. * gcc.c-torture/compile/931013-2.c: Likewise. * gcc.c-torture/compile/931102-2.c: Likewise. * gcc.c-torture/compile/931203-1.c: Likewise. * gcc.c-torture/compile/940718-1.c: Likewise. * gcc.c-torture/compile/941014-1.c: Likewise. * gcc.c-torture/compile/941014-2.c: Likewise. * gcc.c-torture/compile/941014-3.c: Likewise. * gcc.c-torture/compile/941014-4.c: Likewise. * gcc.c-torture/compile/941111-1.c: Likewise. * gcc.c-torture/compile/941113-1.c: Likewise. * gcc.c-torture/compile/950124-1.c: Likewise. * gcc.c-torture/compile/950329-1.c: Likewise. * gcc.c-torture/compile/950612-1.c: Likewise. * gcc.c-torture/compile/950618-1.c: Likewise. * gcc.c-torture/compile/950719-1.c: Likewise. * gcc.c-torture/compile/950910-1.c: Likewise. * gcc.c-torture/compile/950922-1.c: Likewise. * gcc.c-torture/compile/951106-1.c: Likewise. * gcc.c-torture/compile/951222-1.c: Likewise. * gcc.c-torture/compile/960106-1.c: Likewise. * gcc.c-torture/compile/960319-1.c: Likewise. * gcc.c-torture/compile/960829-1.c: Likewise. * gcc.c-torture/compile/970206-1.c: Likewise. * gcc.c-torture/compile/980825-1.c: Likewise. * gcc.c-torture/compile/990829-1.c: Likewise. * gcc.c-torture/compile/991213-2.c: Likewise.
2023-10-18Fix expansion of `(a & 2) != 1`Andrew Pinski1-0/+16
I had a thinko in r14-1600-ge60593f3881c72a96a3fa4844d73e8a2cd14f670 where we would remove the `& CST` part if we ended up not calling expand_single_bit_test. This fixes the problem by introducing a new variable that will be used for calling expand_single_bit_test. As afar as I know this can only show up when disabling optimization passes as this above form would have been optimized away. Committed as obvious after a bootstrap/test on x86_64-linux-gnu. PR middle-end/111863 gcc/ChangeLog: * expr.cc (do_store_flag): Don't over write arg0 when stripping off `& POW2`. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr111863-1.c: New test.
2023-10-17ssa_name_has_boolean_range vs signed-boolean:31 typesAndrew Pinski3-0/+43
This turns out to be a latent bug in ssa_name_has_boolean_range where it would return true for all boolean types but all of the uses of ssa_name_has_boolean_range was expecting 0/1 as the range rather than [-1,0]. So when I fixed vector lower to do all comparisons in boolean_type rather than still in the signed-boolean:31 type (to fix a different issue), the pattern in match for `-(type)!A -> (type)A - 1.` would assume A (which was signed-boolean:31) had a range of [0,1] which broke down and sometimes gave us -1/-2 as values rather than what we were expecting of -1/0. This was the simpliest patch I found while testing. We have another way of matching [0,1] range which we could use instead of ssa_name_has_boolean_range except that uses only the global ranges rather than the local range (during VRP). I tried to clean this up slightly by using gimple_match_zero_one_valuedp inside ssa_name_has_boolean_range but that failed because due to using only the global ranges. I then tried to change get_nonzero_bits to use the local ranges at the optimization time but that failed also because we would remove branches to __builtin_unreachable during evrp and lose information as we don't set the global ranges during evrp. OK? Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/110817 gcc/ChangeLog: * tree-ssanames.cc (ssa_name_has_boolean_range): Remove the check for boolean type as they don't have "[0,1]" range. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr110817-1.c: New test. * gcc.c-torture/execute/pr110817-2.c: New test. * gcc.c-torture/execute/pr110817-3.c: New test.
2023-10-13C99 testsuite readiness: Some verified test case adjustmentsFlorian Weimer3-9/+8
The updated test cases still reproduce the bugs with old compilers. gcc/testsuite/ * gcc.c-torture/compile/pc44485.c (func_21): Add missing cast. * gcc.c-torture/compile/pr106101.c: Use builtins to avoid calls to undeclared functions. Change type of yyvsp to char ** and introduce yyvsp1 to avoid type errors. * gcc.c-torture/execute/pr111331-1.c: Add missing int. * gcc.dg/pr100512.c: Unreduce test case and suppress only -Wpointer-to-int-cast. * gcc.dg/pr103003.c: Likewise. * gcc.dg/pr103451.c: Add cast to long and suppress -Wdiv-by-zero only. * gcc.dg/pr68435.c: Avoid implicit int and missing static function implementation warning.
2023-10-13C99 test suite readiness: Some unverified test case adjustmentsFlorian Weimer8-9/+20
These changes are assumed not to interfere with the test objective, but it was not possible to reproduce the historic test case failures (with or without the modification here). gcc/testsuite/ * gcc.c-torture/compile/20000105-1.c: Add missing int return type. Call __builtin_exit instead of exit. * gcc.c-torture/compile/20000105-2.c: Add missing void types. * gcc.c-torture/compile/20000211-1.c (Lstream_fputc, Lstream_write) (Lstream_flush_out, parse_doprnt_spec): Add missing function declaration. * gcc.c-torture/compile/20000224-1.c (call_critical_lisp_code): Declare. * gcc.c-torture/compile/20000314-2.c: Add missing void types. * gcc.c-torture/compile/980816-1.c (XtVaCreateManagedWidget) (XtAddCallback): Likewise. * gcc.c-torture/compile/pr49474.c: Use struct gfc_formal_arglist * instead of (implied) int type. * gcc.c-torture/execute/20001111-1.c (foo): Add cast to char *. (main): Call __builtin_abort and __builtin_exit.
2023-10-13C99 test suite readiness: Mark some C89 testsFlorian Weimer5-0/+5
Add -std=gnu89 to some tests which evidently target C89-only language features. gcc/testsuite/ * gcc.c-torture/compile/920501-11.c: Compile with -std=gnu89. * gcc.c-torture/compile/920501-23.c: Likewise. * gcc.c-torture/compile/920501-8.c: Likewise. * gcc.c-torture/compile/920701-1.c: Likewise. * gcc.c-torture/compile/930529-1.c: Likewise.
2023-10-06MATCH: Fix infinite loop between `vec_cond(vec_cond(a,b,0), c, d)` and `a & b`Andrew Pinski1-0/+7
Match has a pattern which converts `vec_cond(vec_cond(a,b,0), c, d)` into `vec_cond(a & b, c, d)` but since in this case a is a comparison fold will change `a & b` back into `vec_cond(a,b,0)` which causes an infinite loop. The best way to fix this is to enable the patterns for vec_cond(*,vec_cond,*) only for GIMPLE so we don't get an infinite loop for fold any more. Note this is a latent bug since these patterns were added in r11-2577-g229752afe3156a and was exposed by r14-3350-g47b833a9abe1 where now able to remove a VIEW_CONVERT_EXPR. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR middle-end/111699 gcc/ChangeLog: * match.pd ((c ? a : b) op d, (c ? a : b) op (c ? d : e), (v ? w : 0) ? a : b, c1 ? c2 ? a : b : b): Enable only for GIMPLE. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/pr111699-1.c: New test.
2023-09-26PHIOPT: Fix minmax_replacement for three wayAndrew Pinski1-0/+38
So when diamond bb support was added to minmax_replacement in r13-1950-g9bb19e143cfe, the code was not expecting the alt_middle_bb not to exist if it was empty (for threeway_p). So when factor_out_conditional_conversion was used to factor out conversions, it turns out the assumption for alt_middle_bb to be wrong and we ended up with threeway_p being true but having middle_bb being empty but alt_middle_bb not being empty which causes wrong code in many cases. This patch fixes the issue by adding a test for the 2 cases where the assumption on threeway_p case having the other bb being empty. Changes made: v2: Fix test for `(a <= u) b = MAX(a, d) else b = u`. Note my plan for GCC 15 is remove minmax_replacement as match.pd will catch all cases at that point. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/111469 gcc/ChangeLog: * tree-ssa-phiopt.cc (minmax_replacement): Fix the assumption for the `non-diamond` handling cases of diamond code. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr111469-1.c: New test.
2023-09-25Fix PR 110386: backprop vs ABSU_EXPRAndrew Pinski2-0/+20
The issue here is that when backprop tries to go and strip sign ops, it skips over ABSU_EXPR but ABSU_EXPR not only does an ABS, it also changes the type to unsigned. Since strip_sign_op_1 is only supposed to strip off sign changing operands and not ones that change types, removing ABSU_EXPR here is correct. We don't handle nop conversions so this does cause any missed optimizations either. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/110386 gcc/ChangeLog: * gimple-ssa-backprop.cc (strip_sign_op_1): Remove ABSU_EXPR. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/pr110386-1.c: New test. * gcc.c-torture/compile/pr110386-2.c: New test.
2023-09-18MATCH: Make zero_one_valued_p non-recursive fullyAndrew Pinski1-0/+13
So it turns out VN can't handle any kind of recursion for match. In this case we have `b = a & -1` and we try to match a as being zero_one_valued_p and VN returns b as being the value and we just go into an infinite loop at this point. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. Note genmatch should warn (or error out) if this gets detected so I filed PR 111446 which I will be looking into next week or the week after so we don't run into this issue again. PR tree-optimization/111442 gcc/ChangeLog: * match.pd (zero_one_valued_p): Have the bit_and match not be recursive. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/pr111442-1.c: New test.
2023-09-18MATCH: Avoid recursive zero_one_valued_p for conversionsAndrew Pinski1-0/+18
So when VN finds a name which has a nop conversion, it says both names are equivalent to each other and the valuaization function for one will return the other. This normally does not cause any issues as there is no recursive matches. But after r14-4038-gb975c0dc3be285, there was one added. So we would do an infinite recursion on the match and never finish. This fixes the issue (and adds a comment in match.pd) by for converts just handle one level instead of being recursive always. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. Note the testcase was reduced from tree-ssa-loop-niter.cc and then changed slightly into C rather than C++ but it still needs exceptions turned on get the IR that VN would produce this equivalence relationship going on. Also had to turn off early inline to force put to be inlined later. PR tree-optimization/111435 gcc/ChangeLog: * match.pd (zero_one_valued_p): Don't do recursion on converts. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/pr111435-1.c: New test.
2023-09-18MATCH: Add simplifications of `(a == CST) & a`Andrew Pinski1-0/+39
`(a == CST) & a` can be either simplified to simplying `a == CST` or 0 depending on the first bit of the CST. This is an extension of the already pattern of `X & !X` and allows us to remove the 2 xfails on gcc.dg/binop-notand1a.c and gcc.dg/binop-notand4a.c. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/111431 gcc/ChangeLog: * match.pd (`(a == CST) & a`): New pattern. gcc/testsuite/ChangeLog: * gcc.dg/binop-notand1a.c: Remove xfail. * gcc.dg/binop-notand4a.c: Likewise. * gcc.c-torture/execute/pr111431-1.c: New test. * gcc.dg/binop-andeq1.c: New test. * gcc.dg/binop-andeq2.c: New test. * gcc.dg/binop-notand7.c: New test. * gcc.dg/binop-notand7a.c: New test.
2023-09-15MATCH: Fix `(1 >> X) != 0` pattern for vector typesAndrew Pinski1-0/+13
I had missed that integer_onep can match vector types with uniform constant of `1`. This means the shifter could be an scalar type and then doing a comparison against `0` would be an invalid transformation. This fixes the problem by adding a check for the type of the integer_onep to make sure it is a INTEGRAL_TYPE_P (which does not match a vector type). OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/111414 gcc/ChangeLog: * match.pd (`(1 >> X) != 0`): Check to see if the integer_onep was an integral type (not a vector type). gcc/testsuite/ChangeLog: * gcc.c-torture/compile/pr111414-1.c: New test.
2023-09-13MATCH: [PR111364] Add some more minmax cmp operand simplificationsAndrew Pinski1-0/+51
This adds a few more minmax cmp operand simplifications which were missed before. `MIN(a,b) < a` -> `a > b` `MIN(a,b) >= a` -> `a <= b` `MAX(a,b) > a` -> `a < b` `MAX(a,b) <= a` -> `a >= b` OK? Bootstrapped and tested on x86_64-linux-gnu. Note gcc.dg/pr96708-negative.c needed to updated to remove the check for MIN/MAX as they have been optimized (correctly) away. PR tree-optimization/111364 gcc/ChangeLog: * match.pd (`MIN (X, Y) == X`): Extend to min/lt, min/ge, max/gt, max/le. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/minmaxcmp-1.c: New test. * gcc.dg/tree-ssa/minmaxcmp-2.c: New test. * gcc.dg/pr96708-negative.c: Update testcase. * gcc.dg/pr96708-positive.c: Add comment about `return 0`.
2023-09-12MATCH: Simplify (a CMP1 b) ^ (a CMP2 b)Andrew Pinski1-0/+115
This adds the missing optimizations here. Note we don't need to match where CMP1 and CMP2 are complements of each other as that is already handled elsewhere. I added a new executable testcase to make sure we optimize it correctly as I had originally messed up one of the entries for the resulting comparison to make sure they were 100% correct. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/107881 gcc/ChangeLog: * match.pd (`(a CMP1 b) ^ (a CMP2 b)`): New pattern. (`(a CMP1 b) == (a CMP2 b)`): New pattern. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr107881-1.c: New test. * gcc.dg/tree-ssa/cmpeq-4.c: New test. * gcc.dg/tree-ssa/cmpxor-1.c: New test.
2023-09-10Fix PR 111331: wrong code for `a > 28 ? MIN<a, 28> : 29`Andrew Pinski3-0/+51
The problem here is after r6-7425-ga9fee7cdc3c62d0e51730, the comparison to see if the transformation could be done was using the wrong value. Instead of see if the inner was LE (for MIN and GE for MAX) the outer value, it was comparing the inner to the value used in the comparison which was wrong. The match pattern copied the same logic mistake when they were added in r14-1411-g17cca3c43e2f49 . OK? Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: PR tree-optimization/111331 * match.pd (`(a CMP CST1) ? max<a,CST2> : a`): Fix the LE/GE comparison to the correct value. * tree-ssa-phiopt.cc (minmax_replacement): Fix the LE/GE comparison for the `(a CMP CST1) ? max<a,CST2> : a` optimization. gcc/testsuite/ChangeLog: PR tree-optimization/111331 * gcc.c-torture/execute/pr111331-1.c: New test. * gcc.c-torture/execute/pr111331-2.c: New test. * gcc.c-torture/execute/pr111331-3.c: New test.
2023-08-30tree-ssa-strlen: Fix up handling of conditionally zero memcpy [PR110914]Jakub Jelinek1-0/+22
The following testcase is miscompiled since r279392 aka r10-5451-gef29b12cfbb4979 The strlen pass has adjust_last_stmt function, which performs mainly strcat or strcat-like optimizations (say strcpy (x, "abcd"); strcat (x, p); or equivalent memcpy (x, "abcd", strlen ("abcd") + 1); char *q = strchr (x, 0); memcpy (x, p, strlen (p)); etc. where the first stmt stores '\0' character at the end but next immediately overwrites it and so the first memcpy can be adjusted to store 1 fewer bytes. handle_builtin_memcpy called this function in two spots, the first one guarded like: if (olddsi != NULL && tree_fits_uhwi_p (len) && !integer_zerop (len)) adjust_last_stmt (olddsi, stmt, false); i.e. only for constant non-zero length. The other spot can call it even for non-constant length but in that case we punt before that if that length isn't length of some string + 1, so again non-zero. The r279392 change I assume wanted to add some warning stuff and changed it like if (olddsi != NULL - && tree_fits_uhwi_p (len) && !integer_zerop (len)) - adjust_last_stmt (olddsi, stmt, false); + { + maybe_warn_overflow (stmt, len, rvals, olddsi, false, true); + adjust_last_stmt (olddsi, stmt, false); + } While maybe_warn_overflow possibly handles non-constant length fine, adjust_last_stmt really relies on length to be non-zero, which !integer_zerop (len) alone doesn't guarantee. While we could for len being SSA_NAME ask the ranger or tree_expr_nonzero_p, I think adjust_last_stmt will not benefit from it much, so the following patch just restores the above condition/previous behavior for the adjust_last_stmt call only. 2023-08-30 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/110914 * tree-ssa-strlen.cc (strlen_pass::handle_builtin_memcpy): Don't call adjust_last_stmt unless len is known constant. * gcc.c-torture/execute/pr110914.c: New test.
2023-08-24Fix tests for PR 106537.Jose E. Marchesi2-4/+8
This patch fixes the tests for PR 106537 (support for -W[no]-compare-distinct-pointer-types) which were expecting the warning when checking for equality/inequality of void pointers with non-function pointers. gcc/testsuite/ChangeLog: PR c/106537 * gcc.c-torture/compile/pr106537-1.c: Comparing void pointers to non-function pointers is legit. * gcc.c-torture/compile/pr106537-2.c: Likewise.
2023-08-24MATCH: [PR111109] Fix bit_ior(cond,cond) when comparisons are fpAndrew Pinski1-0/+78
The patterns that were added in r13-4620-g4d9db4bdd458, missed that (a > b) and (a <= b) are not inverse of each other for floating point comparisons (if NaNs are supported). Even though there was a check for intergal types, it was only for the result of the cond rather for the type of what is being compared. The fix is to check to see if cmp and icmp are inverse of each other by using the invert_tree_comparison function. OK for trunk and GCC 13 branch? Bootstrapped and tested on x86_64-linux-gnu with no regressions. I added the testcase to execute/ieee as it requires support for NAN. PR tree-optimization/111109 gcc/ChangeLog: * match.pd (ior(cond,cond), ior(vec_cond,vec_cond)): Add check to make sure cmp and icmp are inverse. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/ieee/fp-cmp-cond-1.c: New test.
2023-08-23Add testcase for PR110940Jan Hubicka1-0/+19
gcc/testsuite/ChangeLog: PR middle-end/110940 * gcc.c-torture/compile/pr110940.c: New test.
2023-08-17Add warning options -W[no-]compare-distinct-pointer-typesJose E. Marchesi3-0/+98
GCC emits pedwarns unconditionally when comparing pointers of different types, for example: int xdp_context (struct xdp_md *xdp) { void *data = (void *)(long)xdp->data; __u32 *metadata = (void *)(long)xdp->data_meta; __u32 ret; if (metadata + 1 > data) return 0; return 1; } /home/jemarch/foo.c: In function ‘xdp_context’: /home/jemarch/foo.c:15:20: warning: comparison of distinct pointer types lacks a cast 15 | if (metadata + 1 > data) | ^ LLVM supports an option -W[no-]compare-distinct-pointer-types that can be used in order to enable or disable the emission of such warnings. It is enabled by default. This patch adds the same options to GCC. Documentation and testsuite updated included. Regtested in x86_64-linu-gnu. No regressions observed. gcc/ChangeLog: PR c/106537 * doc/invoke.texi (Option Summary): Mention -Wcompare-distinct-pointer-types under `Warning Options'. (Warning Options): Document -Wcompare-distinct-pointer-types. gcc/c-family/ChangeLog: PR c/106537 * c.opt (Wcompare-distinct-pointer-types): New option. gcc/c/ChangeLog: PR c/106537 * c-typeck.cc (build_binary_op): Warning on comparing distinct pointer types only when -Wcompare-distinct-pointer-types. gcc/testsuite/ChangeLog: PR c/106537 * gcc.c-torture/compile/pr106537-1.c: New test. * gcc.c-torture/compile/pr106537-2.c: Likewise. * gcc.c-torture/compile/pr106537-3.c: Likewise.
2023-08-11match.pd: Implement missed optimization ((x ^ y) & z) | x -> (z & y) | x ↵Drew Ross1-0/+33
[PR109938] Adds a simplification for ((x ^ y) & z) | x to be folded into (z & y) | x. Merges this simplification with ((x | y) & z) | x -> (z & y) | x to prevent duplicate pattern. 2023-08-11 Drew Ross <drross@redhat.com> Jakub Jelinek <jakub@redhat.com> PR tree-optimization/109938 * match.pd (((x ^ y) & z) | x -> (z & y) | x): New simplification. * gcc.c-torture/execute/pr109938.c: New test. * gcc.dg/tree-ssa/pr109938.c: New test.
2023-08-10Fix PR 110954: wrong code with cmp | !cmpAndrew Pinski1-0/+10
This was an oversight on my part forgetting that cmp will might have a different true value than all ones but will have a value of 1 in most cases. This means if we have `(f < 0) | !(f < 0)` we would optimize this to -1 rather than just 1. This is version 2 of the patch. Decided to go down a different route than just checking if the precission was 1 inside bitwise_inverted_equal_p. So instead bitwise_inverted_equal_p gets passed an argument that will be set if there was a comparison that was being compared and the user of bitwise_inverted_equal_p decides what needs to be done. In most uses of bitwise_inverted_equal_p, the check will be `!wascmp || element_precision (type) == 1` . But in the case of `a & ~a` and `a ^| ~a` we can handle the case of wascmp by using constant_boolean_node isntead. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/110954 gcc/ChangeLog: * generic-match-head.cc (bitwise_inverted_equal_p): Add wascmp argument and set it accordingly. * gimple-match-head.cc (bitwise_inverted_equal_p): Add wascmp argument to the macro. (gimple_bitwise_inverted_equal_p): Add wascmp argument and set it accordingly. * match.pd (`a & ~a`, `a ^| ~a`): Update call to bitwise_inverted_equal_p and handle wascmp case. (`(~x | y) & x`, `(~x | y) & x`, `a?~t:t`): Update call to bitwise_inverted_equal_p and check to see if was !wascmp or if precision was 1. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr110954-1.c: New test.
2023-08-04Fix PR 110874: infinite loop in gimple_bitwise_inverted_equal_p with freAndrew Pinski1-0/+17
This changes gimple_bitwise_inverted_equal_p to use a 2 different match patterns to try to match bit_not wrapped with a possible nop_convert and a comparison also wrapped with a possible nop_convert. This is to avoid being recursive. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/110874 * gimple-match-head.cc (gimple_bit_not_with_nop): New declaration. (gimple_maybe_cmp): Likewise. (gimple_bitwise_inverted_equal_p): Rewrite to use gimple_bit_not_with_nop and gimple_maybe_cmp instead of being recursive. * match.pd (bit_not_with_nop): New match pattern. (maybe_cmp): Likewise. gcc/testsuite/ChangeLog: PR tree-optimization/110874 * gcc.c-torture/compile/pr110874-a.c: New test.
2023-08-02Fix `~X & X` and `~X | X` patternsAndrew Pinski1-0/+68
As Jakub noticed in https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626039.html what I did was not totally correct because sometimes chosing the wrong type. So to get back to what the original code but keeping around the use of bitwise_inverted_equal_p, we just need to check if the types of the two catupures are the same type. Also adds a testcase for the problem Jakub found. Committed as obvious after a bootstrap and test. gcc/ChangeLog: * match.pd (`~X & X`): Check that the types match. (`~x | x`, `~x ^ x`): Likewise. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/20230802-1.c: New test.
2023-07-24match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]Drew Ross1-0/+41
Adds a simplification for (~X | Y) ^ X to be folded into ~(X & Y). Also adds the macro bitwise_equal_p for generic and gimple which returns true iff EXPR1 and EXPR2 have the same value. This helps to reduce the number of nop_converts necessary to match the pattern. PR middle-end/109986 gcc/ChangeLog: * generic-match-head.cc (bitwise_equal_p): New macro. * gimple-match-head.cc (bitwise_equal_p): New macro. (gimple_nop_convert): Declare. (gimple_bitwise_equal_p): Helper for bitwise_equal_p. * match.pd ((~X | Y) ^ X -> ~(X & Y)): New simplification. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr109986.c: New test. * gcc.dg/tree-ssa/pr109986.c: New test. Co-authored-by: Jakub Jelinek <jakub@redhat.com>
2023-07-21Require target lra in gcc.c-torture/compile/asmgoto-6.cJohn David Anglin1-1/+1
2023-07-21 John David Anglin <danglin@gcc.gnu.org> gcc/testsuite/ChangeLog: * gcc.c-torture/compile/asmgoto-6.c: Require target lra.
2023-07-19[PATCH] Fix tree-opt/110252: wrong code due to phiopt using flow sensitive ↵Andrew Pinski4-0/+46
info during match Match will query ranger via tree_nonzero_bits/get_nonzero_bits for 2 and 3rd operand of the COND_EXPR and phiopt tries to do create the COND_EXPR even if we moving one statement. That one statement could have some flow sensitive information on it based on the condition that is for the COND_EXPR but that might create wrong code if the statement was moved out. This is similar to the previous version of the patch except now we use flow_sensitive_info_storage instead of manually doing the save/restore and also handle all defs on a gimple statement rather than just for lhs of the gimple statement. Oh and a few more testcases were added that was failing before. OK? Bootsrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/110252 gcc/ChangeLog: * tree-ssa-phiopt.cc (class auto_flow_sensitive): New class. (auto_flow_sensitive::auto_flow_sensitive): New constructor. (auto_flow_sensitive::~auto_flow_sensitive): New deconstructor. (match_simplify_replacement): Temporarily remove the flow sensitive info on the two statements that might be moved. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/phi-opt-25b.c: Updated as __builtin_parity loses the nonzerobits info. * gcc.c-torture/execute/pr110252-1.c: New test. * gcc.c-torture/execute/pr110252-2.c: New test. * gcc.c-torture/execute/pr110252-3.c: New test. * gcc.c-torture/execute/pr110252-4.c: New test.
2023-07-19Fix PR110726: a | (a == b) can sometimes produce wrong codeAndrew Pinski1-0/+33
So I had missed/forgot that EQ_EXPR could have an non boolean type for generic when I implemented r14-2556-g0407ae8a7732d9. This patch adds check for one bit precision intergal type which fixes the problem. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/110726 gcc/ChangeLog: * match.pd ((a|b)&(a==b),a|(a==b),(a&b)|(a==b)): Add checks to make sure the type was one bit precision intergal type. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/bitops-1.c: New test.
2023-07-16Fix PR 110666: `(a != 2) == a` produces wrong codeAndrew Pinski1-0/+51
I had messed up the case where the outer operator is `==`. The check for the resulting should have been `==` and not `!=`. This patch fixes that and adds a full runtime testcase now for all cases to make sure it works. OK? Bootstrapped and tested on x86-64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/110666 * match.pd (A NEEQ (A NEEQ CST)): Fix Outer EQ case. gcc/testsuite/ChangeLog: PR tree-optimization/110666 * gcc.c-torture/execute/pr110666-1.c: New test.