On both x86_64-apple-darwin* and i686-apple-darwin* using -m64, the gcc.target/x86_64/abi/test_struct_returning.c test cases... FAIL: gcc.target/x86_64/abi/test_struct_returning.c execution, -O3 -fomit-frame-pointer FAIL: gcc.target/x86_64/abi/test_struct_returning.c execution, -O3 -fomit-frame-pointer -funroll-loops FAIL: gcc.target/x86_64/abi/test_struct_returning.c execution, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions FAIL: gcc.target/x86_64/abi/test_struct_returning.c execution, -O3 -g started to fail somewhere between 20090425 and 20090516. The failed tests generate the following warnings... Executing on host: gcc /sw/src/fink.build/gcc45-4.4.999-20090516/gcc-4.5-20090516/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c /sw/src/fink.build/gcc45-4.4.999-20090516/gcc-4.5-20090516/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s -w -O0 -W -Wall -Wno-abi -lm -o /sw/src/fink.build/gcc45-4.4.999-20090516/darwin_objdir/gcc/testsuite/gcc/test_struct_returning.x0 (timeout = 300) cc1: warning: command line option "-Wno-abi" is valid for C++/ObjC++ but not for C output is: cc1: warning: command line option "-Wno-abi" is valid for C++/ObjC++ but not for C FAIL: gcc.target/x86_64/abi/test_struct_returning.c compilation, -O0 These warnings don't appear in the gcc.log of 20090425.
The output from 20090425 shows... Executing on host: /sw/src/fink.build/gcc45-4.4.999-20090425/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc45-4.4.999-20090425/darwin_objdir/gcc/ /sw/src/fink.build/gcc45-4.4.999-20090425/gcc-4.5-20090425/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c /sw/src/fink.build/gcc45-4.4.999-20090425/gcc-4.5-20090425/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s -w -O0 -W -Wall -Wno-abi -lm -o /sw/src/fink.build/gcc45-4.4.999-20090425/darwin_objdir/gcc/testsuite/gcc/test_struct_returning.x0 (timeout = 300) PASS: gcc.target/x86_64/abi/test_struct_returning.c compilation, -O0 Setting LD_LIBRARY_PATH to :/sw/src/fink.build/gcc45-4.4.999-20090425/darwin_objdir/gcc::/sw/src/fink.build/gcc45-4.4.999-20090425/darwin_objdir/gcc PASS: gcc.target/x86_64/abi/test_struct_returning.c execution, -O0 Notice the compiler in the failing case now is only 'gcc' rather than '/sw/src/fink.build/gcc45-4.4.999-20090425/darwin_objdir/gcc/xgcc'. This is probably broken on all platforms but only darwin is revealing the fact that the test is being done with the system compiler and not the newly built compiler.
Ignore the comments on the warnings. This was a glitch from running... make -k check-gcc RUNTESTFLAGS="abi-x86_64.exp=gcc.target/x86_64/abi/test_struct_returning.c" in darwin_objdir which seems to cause the compiler to be incorrectly set. The bug is in execution.
A regression hunt shows that r147824 passes all of gcc.target/x86_64/abi/test_struct_returning.c's execution tests but r147829 fails... FAIL: gcc.target/x86_64/abi/test_struct_returning.c execution, -O3 -fomit-frame-pointer FAIL: gcc.target/x86_64/abi/test_struct_returning.c execution, -O3 -fomit-frame-pointer -funroll-loops FAIL: gcc.target/x86_64/abi/test_struct_returning.c execution, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions FAIL: gcc.target/x86_64/abi/test_struct_returning.c execution, -O3 -g which suggests that r147829 is the cause. Author: irar Date: Sun May 24 08:44:56 2009 New Revision: 147829 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147829 Log: * doc/passes.texi (Tree-SSA passes): Document SLP pass. * tree-pass.h (pass_slp_vectorize): New pass. * params.h (SLP_MAX_INSNS_IN_BB): Define. * timevar.def (TV_TREE_SLP_VECTORIZATION): Define. * tree-vectorizer.c (timevar.h): Include. (user_vect_verbosity_level): Declare. (vect_location): Fix comment. (vect_set_verbosity_level): Update user_vect_verbosity_level instead of vect_verbosity_level. (vect_set_dump_settings): Add an argument. Ignore user defined verbosity if dump flags require higher level of verbosity. Print to stderr only for loop vectorization. (vectorize_loops): Update call to vect_set_dump_settings. (execute_vect_slp): New function. (gate_vect_slp): Likewise. (struct gimple_opt_pass pass_slp_vectorize): New. * tree-vectorizer.h (struct _bb_vec_info): Define along macros to access its members. (vec_info_for_bb): New function. (struct _stmt_vec_info): Add bb_vinfo and a macro for its access. (VECTORIZATION_ENABLED): New macro. (SLP_ENABLED, SLP_DISABLED): Likewise. (vect_is_simple_use): Add bb_vec_info argument. (new_stmt_vec_info, vect_analyze_data_ref_dependences, vect_analyze_data_refs_alignment, vect_verify_datarefs_alignment, vect_analyze_data_ref_accesses, vect_analyze_data_refs, vect_schedule_slp, vect_analyze_slp): Likewise. (vect_analyze_stmt): Add slp_tree argument. (find_bb_location): Declare. (vect_slp_analyze_bb, vect_slp_transform_bb): Likewise. * tree-vect-loop.c (new_loop_vec_info): Adjust function calls. (vect_analyze_loop_operations, vect_analyze_loop, get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction, vectorizable_reduction, vectorizable_live_operation, vect_transform_loop): Likewise. * tree-data-ref.c (dr_analyze_innermost): Update comment, skip evolution analysis if analyzing a basic block. (dr_analyze_indices): Likewise. (initialize_data_dependence_relation): Skip the test whether the object is invariant for basic blocks. (compute_all_dependences): Skip dependence analysis for data references in basic blocks. (find_data_references_in_stmt): Don't fail in case of invariant access in basic block. (find_data_references_in_bb): New function. (find_data_references_in_loop): Move code to find_data_references_in_bb and add a call to it. (compute_data_dependences_for_bb): New function. * tree-data-ref.h (compute_data_dependences_for_bb): Declare. * tree-vect-data-refs.c (vect_check_interleaving): Adjust to the case that STEP is 0. (vect_analyze_data_ref_dependence): Check for interleaving in case of unknown dependence in basic block and fail in case of dependence in basic block. (vect_analyze_data_ref_dependences): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_compute_data_ref_alignment): Check if it is loop vectorization before calling nested_in_vect_loop_p. (vect_compute_data_refs_alignment): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Adjust function calls. (vect_analyze_data_refs_alignment): Likewise. (vect_analyze_group_access): Fix printing. Skip different checks if DR_STEP is 0. Keep strided stores either in loop or basic block vectorization data structure. Fix indentation. (vect_analyze_data_ref_access): Fix comments, allow zero step in basic blocks. (vect_analyze_data_ref_accesses): Add bb_vinfo argument, get data dependence instances from either loop or basic block vectorization info. (vect_analyze_data_refs): Update comment. Call compute_data_dependences_for_bb to analyze basic blocks. (vect_create_addr_base_for_vector_ref): Check for outer loop only in case of loop vectorization. In case of basic block vectorization use data-ref itself as a base. (vect_create_data_ref_ptr): In case of basic block vectorization: don't advance the pointer, add new statements before the current statement. Adjust function calls. (vect_supportable_dr_alignment): Support only aligned accesses in basic block vectorization. * common.opt (ftree-slp-vectorize): New flag. * tree-vect-patterns.c (widened_name_p): Adjust function calls. (vect_pattern_recog_1): Likewise. * tree-vect-stmts.c (process_use): Likewise. (vect_init_vector): Add new statements in the beginning of the basic block in case of basic block SLP. (vect_get_vec_def_for_operand): Adjust function calls. (vect_finish_stmt_generation): Likewise. (vectorizable_call): Add assert that it is loop vectorization, adjust function calls. (vectorizable_conversion, vectorizable_assignment): Likewise. (vectorizable_operation): In case of basic block SLP, take vectorization factor from statement's type and skip the relevance check. Adjust function calls. (vectorizable_type_demotion): Add assert that it is loop vectorization, adjust function calls. (vectorizable_type_promotion): Likewise. (vectorizable_store): Check for outer loop only in case of loop vectorization. Adjust function calls. For basic blocks, skip the relevance check and don't advance pointers. (vectorizable_load): Likewise. (vectorizable_condition): Add assert that it is loop vectorization, adjust function calls. (vect_analyze_stmt): Add argument. In case of basic block SLP, check that it is not reduction, get vector type, call only supported functions, skip loop specific parts. (vect_transform_stmt): Check for outer loop only in case of loop vectorization. (new_stmt_vec_info): Add new argument and initialize bb_vinfo. (vect_is_simple_use): Fix comment, add new argument, fix conditions for external definition. * passes.c (pass_slp_vectorize): New pass. * tree-vect-slp.c (find_bb_location): New function. (vect_get_and_check_slp_defs): Add argument, adjust function calls, check for patterns only in loops. (vect_build_slp_tree): Add argument, adjust function calls, fail in case of multiple types in basic block SLP. (vect_mark_slp_stmts_relevant): New function. (vect_supported_load_permutation_p): Fix comment. (vect_analyze_slp_instance): Add argument. In case of basic block SLP, take vectorization factor from statement's type, check that unrolling factor is 1. Adjust function call. Save SLP instance in either loop or basic block vectorization structure. Return FALSE, if SLP failed. (vect_analyze_slp): Add argument. Get strided stores groups from either loop or basic block vectorization structure. Return FALSE if basic block SLP failed. (new_bb_vec_info): New function. (destroy_bb_vec_info, vect_slp_analyze_node_operations, vect_slp_analyze_operations, vect_slp_analyze_bb): Likewise. (vect_schedule_slp): Add argument. Get SLP instances from either loop or basic block vectorization structure. Set vectorization factor to be 1 for basic block SLP. (vect_slp_transform_bb): New function. * params.def (PARAM_SLP_MAX_INSNS_IN_BB): Define.
Created attachment 18534 [details] preprocessed source for gcc.target/x86_64/abi/test_struct_returning.c compilation, -O3 -fomit-frame-pointer /sw/src/fink.build/gcc45-4.4.999-20090524/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc45-4.4.999-20090524/darwin_objdir/gcc/ /sw/src/fink.build/gcc45-4.4.999-20090524/gcc-4.5-20090524/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c /sw/src/fink.build/gcc45-4.4.999-20090524/gcc-4.5-20090524/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s -w -O3 -fomit-frame-pointer --save-temps -W -Wall -Wno-abi -lm -o /sw/src/fink.build/gcc45-4.4.999-20090524/darwin_objdir/gcc/testsuite/gcc/test_struct_returning.x3
Created attachment 18535 [details] assembly file from gcc.target/x86_64/abi/test_struct_returning.c compilation, -O3 -fomit-frame-pointer under r147829 /sw/src/fink.build/gcc45-4.4.999-20090524/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc45-4.4.999-20090524/darwin_objdir/gcc/ /sw/src/fink.build/gcc45-4.4.999-20090524/gcc-4.5-20090524/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c /sw/src/fink.build/gcc45-4.4.999-20090524/gcc-4.5-20090524/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s -w -O3 -fomit-frame-pointer --save-temps -W -Wall -Wno-abi -lm -o /sw/src/fink.build/gcc45-4.4.999-20090524/darwin_objdir/gcc/testsuite/gcc/test_struct_returning.x3
Created attachment 18536 [details] assembly file from gcc.target/x86_64/abi/test_struct_returning.c compilation, -O3 -fomit-frame-pointer under r147824 /sw/src/fink.build/gcc45-4.4.999-20090523/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc45-4.4.999-20090523/darwin_objdir/gcc/ /sw/src/fink.build/gcc45-4.4.999-20090523/gcc-4.5-20090523/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c /sw/src/fink.build/gcc45-4.4.999-20090523/gcc-4.5-20090523/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s -w -O3 -fomit-frame-pointer --save-temps -W -Wall -Wno-abi -lm -o /sw/src/fink.build/gcc45-4.4.999-20090523/darwin_objdir/gcc/testsuite/gcc/test_struct_returning.x3
The diff between the test_struct_returning.c test case as compiled with -O3 -fomit-frame-pointer under r147824 vs r147829 is... --- r147824 2009-09-07 23:11:08.000000000 -0400 +++ r147829 2009-09-07 23:10:45.000000000 -0400 @@ -73,13 +73,10 @@ .globl _f_600 _f_600: LFB573: - movl $0x42280000, %eax - movl %eax, -24(%rsp) - movl %eax, -20(%rsp) - movl %eax, -16(%rsp) - movl %eax, -12(%rsp) + movaps LC4(%rip), %xmm0 + movaps %xmm0, -24(%rsp) + movq LC5(%rip), %xmm0 movq -16(%rsp), %xmm1 - movq -24(%rsp), %xmm0 ret LFE573: .align 4,0x90 @@ -365,7 +362,7 @@ .globl _f_101 _f_101: LFB536: - movsd LC4(%rip), %xmm0 + movsd LC6(%rip), %xmm0 ret LFE536: .align 4,0x90 @@ -495,7 +492,7 @@ ret LFE521: .cstring -LC7: +LC9: .ascii "failed in test %d\12\0" .text .align 4,0x90 @@ -541,7 +538,7 @@ .align 4,0x90 L52: movq ___stderrp@GOTPCREL(%rip), %rax - leaq LC7(%rip), %rsi + leaq LC9(%rip), %rsi movq (%rax), %rdi xorl %eax, %eax call _fprintf @@ -645,7 +642,7 @@ je L92 L91: movq ___stderrp@GOTPCREL(%rip), %rax - leaq LC7(%rip), %rsi + leaq LC9(%rip), %rsi movq (%rax), %rdi xorl %eax, %eax call _fprintf @@ -670,7 +667,7 @@ .align 4,0x90 L92: movq _xmm_regs@GOTPCREL(%rip), %rax - movsd LC4(%rip), %xmm0 + movsd LC6(%rip), %xmm0 ucomisd (%rax), %xmm0 jne L87 jp L87 @@ -719,7 +716,7 @@ LCFI6: movq %r15, -8(%rsp) LCFI7: -# 172 "/sw/src/fink.build/gcc45-4.4.999-20090523/gcc-4.5-20090523/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c" 1 +# 172 "/sw/src/fink.build/gcc45-4.4.999-20090524/gcc-4.5-20090524/gcc/testsuite/gcc.target/x86_64/abi/test_struct_returning.c" 1 xor %rax, %rax xor %rbx, %rbx xor %rcx, %rcx @@ -823,7 +820,7 @@ .align 4,0x90 L133: movq ___stderrp@GOTPCREL(%rip), %rax - leaq LC7(%rip), %rsi + leaq LC9(%rip), %rsi movq (%rax), %rdi xorl %eax, %eax call _fprintf @@ -883,7 +880,7 @@ .align 4,0x90 L99: movq _xmm_regs@GOTPCREL(%rip), %rax - movsd LC4(%rip), %xmm0 + movsd LC6(%rip), %xmm0 ucomisd (%rax), %xmm0 jp L119 je L138 @@ -930,7 +927,7 @@ .align 4,0x90 L139: movq _xmm_regs@GOTPCREL(%rip), %rax - movsd LC4(%rip), %xmm0 + movsd LC6(%rip), %xmm0 ucomisd (%rax), %xmm0 jne L117 jp L117 @@ -1927,8 +1924,8 @@ .comm _fregs,448,5 .comm _num_iregs,4,2 .comm _num_fregs,4,2 -.comm _current_test,4,2 -.comm _struct_addr,8,3 +.comm _current_test,4,4 +.comm _struct_addr,8,4 .literal4 .align 2 LC0: @@ -1941,8 +1938,19 @@ LC3: .long 0 .long 1078296576 - .align 3 + .literal16 + .align 4 LC4: + .long 1109917696 + .long 1109917696 + .long 1109917696 + .long 1109917696 + .literal8 + .align 3 +LC5: + .quad 4767060206681587712 + .align 3 +LC6: .long 0 .long 1078263808 .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
Attempting to obtain a backtrace for test_struct_returning.x3 built with -O3 -fomit-frame-pointer under r147829, I can only get... [MacPro:gcc/testsuite/gcc] root# gdb ./test_struct_returning.x3 GNU gdb 6.3.50-20050815 (Apple version gdb-1344) (Fri Jul 3 01:19:56 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done (gdb) r Starting program: /sw/src/fink.build/gcc45-4.4.999-20090524/darwin_objdir/gcc/testsuite/gcc/test_struct_returning.x3 limit: stacksize: Can't remove limit (Invalid argument) Reading symbols for shared libraries ++. done Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 0x0000000100001807 in f_600 () (gdb) bt #0 0x0000000100001807 in f_600 () #1 0x000000010000376d in snapshot_ret () Previous frame inner to this frame (gdb could not unwind past this frame) (gdb)
Looks related to PR 39907.
What happens if you change either of these to movups: + movaps LC4(%rip), %xmm0 + movaps %xmm0, -24(%rsp) My bet is on the second one, -24(%rsp) is not 16byte aligned.
(In reply to comment #9) > Looks related to PR 39907. Ah, indeed. Jack, just change asm-support-darwin.s as [1]. [1] http://gcc.gnu.org/viewcvs/trunk/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S?r1=147667&r2=147666&pathrev=147667
Patch posted at http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00569.html.
Subject: Bug 41288 Author: uros Date: Fri Sep 18 15:16:44 2009 New Revision: 151855 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151855 Log: PR testsuite/41288 * gcc.target/x86_64/abi/asm-support-darwin.s (snapshot_ret): Preserve stack alignment. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s
Subject: Bug 41288 Author: uros Date: Fri Sep 18 17:11:57 2009 New Revision: 151858 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151858 Log: PR testsuite/41288 * gcc.target/x86_64/abi/asm-support-darwin.s (snapshot_ret): Preserve stack alignment. Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog branches/gcc-4_4-branch/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s
Subject: Bug 41288 Author: uros Date: Fri Sep 18 17:12:41 2009 New Revision: 151859 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151859 Log: PR testsuite/41288 * gcc.target/x86_64/abi/asm-support-darwin.s (snapshot_ret): Preserve stack alignment. Modified: branches/gcc-4_3-branch/gcc/testsuite/ChangeLog branches/gcc-4_3-branch/gcc/testsuite/gcc.target/x86_64/abi/asm-support-darwin.s
Fixed everywhere.