[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #2 from Iain Sandoe --- note this *breaks bootstrap* for the normal language set. reduced testcase: int foo (int a, ...) { void *args; args = __builtin_apply_args (); return 0; } /src/test/pr58269.c:7:1: internal compiler error: in check_rtl, at lra.c:2034
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #3 from Iain Sandoe --- bt #0 0x000100d7805a in internal_error (gmsgid=0x404 ) at /src/gcc-live-trunk/gcc/diagnostic.c:1120 #1 0x000100d78266 in fancy_abort (file=Could not find the frame base for "_Z11fancy_abortPKciS0_". ) at /src/gcc-live-trunk/gcc/diagnostic.c:1180 #2 0x0001007e3f70 in check_rtl (final_p=true) at /src/gcc-live-trunk/gcc/lra.c:2034 #3 0x0001007e49dd in lra (f=0x0) at /src/gcc-live-trunk/gcc/lra.c:2426 #4 0x00010078da96 in do_reload () at /src/gcc-live-trunk/gcc/ira.c:4689 #5 0x00010078dd4f in rest_of_handle_reload () at /src/gcc-live-trunk/gcc/ira.c:4818 #6 0x00010078dd9f in execute (this=0x141e17400) at /src/gcc-live-trunk/gcc/ira.c:4847 #7 0x00010089bbce in execute_one_pass (pass=0x141e17400) at /src/gcc-live-trunk/gcc/passes.c:2201 #8 0x00010089be07 in execute_pass_list (pass=0x141e17400) at /src/gcc-live-trunk/gcc/passes.c:2253 #9 0x00010089be38 in execute_pass_list (pass=0x141e16320) at /src/gcc-live-trunk/gcc/passes.c:2254 #10 0x0001004944d1 in expand_function (node=0x142c0bd10) at /src/gcc-live-trunk/gcc/cgraphunit.c:1690 #11 0x000100494d41 in output_in_order () at /src/gcc-live-trunk/gcc/cgraphunit.c:1884 #12 0x000100495562 in compile () at /src/gcc-live-trunk/gcc/cgraphunit.c:2127 #13 0x00010049570f in finalize_compilation_unit () at /src/gcc-live-trunk/gcc/cgraphunit.c:2209 #14 0x0001000268d5 in c_write_global_declarations () at /src/gcc-live-trunk/gcc/c/c-decl.c:10125 #15 0x0001009ab4ee in compile_file () at /src/gcc-live-trunk/gcc/toplev.c:560 #16 0x0001009adcfb in do_compile () at /src/gcc-live-trunk/gcc/toplev.c:1878 #17 0x0001009adead in toplev_main (argc=14, argv=0x7fff5fbffa00) at /src/gcc-live-trunk/gcc/toplev.c:1954 #18 0x000100d6106b in main (argc=14, argv=0x7fff5fbffa00) at /src/gcc-live-trunk/gcc/main.c:36
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #4 from Iain Sandoe --- Created attachment 30736 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30736&action=edit initial fix AFAICT, the problem here is that "TARGET_SSE && SSE_REGNO_P (regno)" now produces a different answer from pre-201915. So, the patch attached is a necessary (but not proven to be sufficient) fix. We need to audit all uses of SSE_REGNO_P () for darwin (at least). AFAIU, the x86_64 Darwin ABI is the same as the linux/system V - so we should be able to remove special-casing in some places (providing the SSE_REGPARM_MAX values are the Right Fix and correctly specified). I checked the Darwin x86_32 ABI info (briefly) and ISTM that the values for max call arg usage of MMX and SSE regs in i386.h are right, so perhaps we can remove more special-casing there too (not touched so far). Will try some additional tests later - and I'd welcome Mike's PoV here on how we prove "sufficient".
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #5 from Dominique d'Humieres --- With the patch in comment #4 (and the one in pr58239, comment #14) on top of revision 202144, I have successfully bootstrapped with all languages but go on x86_64-apple-darwin10. Note that the reported ICE occurs only for the 64 bit mode and it break all the test in the suite that call __builtin_apply_args, gcc.target/i386/avx-vzeroupper-27.c with the reported ICE and the others with /opt/gcc/work/gcc/testsuite/gcc.target/i386/builtin-apply-mmx.c: In function 'bar': /opt/gcc/work/gcc/testsuite/gcc.target/i386/builtin-apply-mmx.c:35:1: internal compiler error: in assign_by_spills, at lra-assigns.c:1281 Thanks for the patch.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #7 from Iain Sandoe --- (In reply to tocarip.intel from comment #6) > -|| (TARGET_SSE && SSE_REGNO_P (regno) && > Those changes are not needed. If TARGET_64BIT is fasle all sse registers > except xmm0-xmm7 should be fixed. Correct fix is > Looks like this will break ABI. Before we returned true for e. g. xmm10. indeed, that was worrying me too. > I couldn't find Darwin ABI to check which behaivor is correct. The ABI for [x86_64] Darwin *should be* the same as "System V Application Binary Interface AMD64 Architecture Processor Supplement Draft Version 0.99.5" it is possible that: (a) GCC has been broken a while and this is just not covered by the test-suite. (b) the system ABI has deviated from the referenced document. However - regardless of the doc, the system ABI is effectively defined by Apple's GCC-4.2.1 (or successor clang, where that is not the system default). > If we want to keep current behaivor something like > Should work. I will apply your revised patch (and keep the second amendment in reserve) and do some compat tests to find out what we need to do to be compliant with the system thanks for the patch, iain.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 tocarip.intel at gmail dot com changed: What|Removed |Added CC||tocarip.intel at gmail dot com --- Comment #6 from tocarip.intel at gmail dot com --- -|| (TARGET_SSE && SSE_REGNO_P (regno) && !fixed_regs[regno])); +|| (TARGET_SSE && SSE_REGNO_P (regno) +&& (regno < FIRST_SSE_REG + SSE_REGPARM_MAX) +&& !fixed_regs[regno])); Those changes are not needed. If TARGET_64BIT is fasle all sse registers except xmm0-xmm7 should be fixed. Correct fix is index 0f4edb3..44b4b16 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4231,10 +4231,10 @@ ix86_conditional_register_usage (void) /* If AVX512F is disabled, squash the registers. */ if (! TARGET_AVX512F) { -for (i = FIRST_EXT_REX_SSE_REG; i < LAST_EXT_REX_SSE_REG; i++) +for (i = FIRST_EXT_REX_SSE_REG; i <= LAST_EXT_REX_SSE_REG; i++) fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = ""; -for (i = FIRST_MASK_REG; i < LAST_MASK_REG; i++) +for (i = FIRST_MASK_REG; i <= LAST_MASK_REG; i++) fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = ""; } } - if (TARGET_MACHO) -{ - if (SSE_REGNO_P (regno) && TARGET_SSE) -return true; -} - else -{ - if (TARGET_SSE && SSE_REGNO_P (regno) - && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) -return true; -} + if (TARGET_SSE && SSE_REGNO_P (regno) + && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) +return true; Looks like this will break ABI. Before we returned true for e. g. xmm10. I couldn't find Darwin ABI to check which behaivor is correct. If we want to keep current behaivor something like index 0f4edb3..a603167 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5708,7 +5708,8 @@ ix86_function_arg_regno_p (int regno) if (TARGET_MACHO) { - if (SSE_REGNO_P (regno) && TARGET_SSE) + if (SSE_REGNO_P (regno) && TARGET_SSE + && ! EXT_REX_SSE_REGNO_P (regno)) return true; } else Should work.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #8 from Kirill Yukhin --- Author: kyukhin Date: Fri Sep 6 10:36:30 2013 New Revision: 202318 URL: http://gcc.gnu.org/viewcvs?rev=202318&root=gcc&view=rev Log: PR target/58269 * config/i386/i386.c (ix86_conditional_register_usage): Proper initialize extended SSE registers. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #9 from Iain Sandoe --- patch for the remainder of the fix posted at: http://gcc.gnu.org/ml/gcc-patches/2013-09/msg00384.html
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #10 from Paolo Carlini --- My x86_64-linux builds too are broken in libobj/sendmsg.c. Thus the issue isn't limited to *-darwin.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #11 from Iain Sandoe --- (In reply to Paolo Carlini from comment #10) > My x86_64-linux builds too are broken in libobj/sendmsg.c. Thus the issue > isn't limited to *-darwin. hmm there appears to be a second issue - also showing on Darwin (perhaps related to 202286) - my test was against 202275.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 Richard Biener changed: What|Removed |Added Target Milestone|--- |4.9.0
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #12 from Paolo Carlini --- Yes, confirmed that on x86_64-linux r202286 is the culprit.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #13 from Dominique d'Humieres --- > Yes, confirmed that on x86_64-linux r202286 is the culprit. See pr58139 comments #6 to #11. I have successfully bootstrapped r202312 on x86_64-apple-darwin10 with the following patch: --- /opt/gcc/_clean/gcc/config/i386/i386.c2013-08-28 18:59:22.0 +0200 +++ /opt/gcc/work/gcc/config/i386/i386.c2013-09-06 10:46:46.0 +0200 @@ -4218,7 +4218,7 @@ ix86_conditional_register_usage (void) /* If AVX512F is disabled, squash the registers. */ if (! TARGET_AVX512F) -for (i = FIRST_EXT_REX_SSE_REG; i < LAST_EXT_REX_SSE_REG; i++) +for (i = FIRST_EXT_REX_SSE_REG; i <= LAST_EXT_REX_SSE_REG; i++) fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = ""; } @@ -5708,7 +5708,8 @@ ix86_function_arg_regno_p (int regno) if (TARGET_MACHO) { - if (SSE_REGNO_P (regno) && TARGET_SSE) + if (SSE_REGNO_P (regno) && TARGET_SSE + && ! EXT_REX_SSE_REGNO_P (regno)) return true; } else @@ -34466,7 +34467,7 @@ ix86_hard_regno_mode_ok (int regno, enum /* OImode move is available only when AVX is enabled. */ return ((TARGET_AVX && mode == OImode) - || VALID_AVX256_REG_MODE (mode) + || (TARGET_AVX && VALID_AVX256_REG_MODE (mode)) || VALID_SSE_REG_MODE (mode) || VALID_SSE2_REG_MODE (mode) || VALID_MMX_REG_MODE (mode) Note that the first hunk is r202318 and that without the second hunk, bootstrap fails with Comparing stages 2 and 3 warning: gcc/cc1-checksum.o differs warning: gcc/cc1obj-checksum.o differs warning: gcc/cc1objplus-checksum.o differs warning: gcc/cc1plus-checksum.o differs Bootstrap comparison failure! libiberty/md5.o differs libiberty/regex.o differs
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #14 from Iain Sandoe --- (In reply to Dominique d'Humieres from comment #13) > > Yes, confirmed that on x86_64-linux r202286 is the culprit. > > See pr58139 comments #6 to #11. > @@ -34466,7 +34467,7 @@ ix86_hard_regno_mode_ok (int regno, enum > >/* OImode move is available only when AVX is enabled. */ >return ((TARGET_AVX && mode == OImode) > - || VALID_AVX256_REG_MODE (mode) > + || (TARGET_AVX && VALID_AVX256_REG_MODE (mode)) > || VALID_SSE_REG_MODE (mode) > || VALID_SSE2_REG_MODE (mode) > || VALID_MMX_REG_MODE (mode) > assuming that the patch above is applied to deal with pr58139, Are you saying that: - if (TARGET_MACHO) -{ - if (SSE_REGNO_P (regno) && TARGET_SSE) -return true; -} - else -{ - if (TARGET_SSE && SSE_REGNO_P (regno) - && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) -return true; -} + if (TARGET_SSE && SSE_REGNO_P (regno) + && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) +return true; gives a compare fail for you?
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #15 from Dominique d'Humieres --- (In reply to Iain Sandoe from comment #14) > assuming that the patch above is applied to deal with pr58139, Indeed! > Are you saying that: > - if (TARGET_MACHO) > -{ > - if (SSE_REGNO_P (regno) && TARGET_SSE) > -return true; > -} > - else > -{ > - if (TARGET_SSE && SSE_REGNO_P (regno) > - && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) > -return true; > -} > + if (TARGET_SSE && SSE_REGNO_P (regno) > + && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) > +return true; > gives a compare fail for you? No: I did not test it although the initial fix worked for me). The comparison failures occur with r202318 and the patch for pr58139 only. These failures are fixed by the patch --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5708,7 +5708,8 @@ ix86_function_arg_regno_p (int regno) if (TARGET_MACHO) { - if (SSE_REGNO_P (regno) && TARGET_SSE) + if (SSE_REGNO_P (regno) && TARGET_SSE + && ! EXT_REX_SSE_REGNO_P (regno)) return true; } else from comment #6.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 Jack Howarth changed: What|Removed |Added CC||howarth at nitro dot med.uc.edu --- Comment #16 from Jack Howarth --- Trunk still ICEs on x86_64-apple-darwin12... /sw/src/fink.build/gcc49-4.9.0-1000/gcc-4.9-20130906/libobjc/sendmsg.c:848:1: internal compiler error: in check_rtl, at lra.c:2034 } ^ using... r202335 | hubicka | 2013-09-06 10:39:17 -0400 (Fri, 06 Sep 2013) | 3 lines * i386.c (ix86_hard_regno_mode_ok): AVX modes are valid only when AVX is enabled.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #17 from Iain Sandoe --- (In reply to Jack Howarth from comment #16) > Trunk still ICEs on x86_64-apple-darwin12... > > /sw/src/fink.build/gcc49-4.9.0-1000/gcc-4.9-20130906/libobjc/sendmsg.c:848:1: > internal compiler error: in check_rtl, at lra.c:2034 > } > ^ > using... > > r202335 | hubicka | 2013-09-06 10:39:17 -0400 (Fri, 06 Sep 2013) | 3 lines > > * i386.c (ix86_hard_regno_mode_ok): AVX modes are valid only when > > AVX is enabled. I have 202322 built with /* OImode move is available only when AVX is enabled. */ return ((TARGET_AVX && mode == OImode) - || VALID_AVX256_REG_MODE (mode) + || (TARGET_AVX && VALID_AVX256_REG_MODE (mode)) || VALID_SSE_REG_MODE (mode) || VALID_SSE2_REG_MODE (mode) || VALID_MMX_REG_MODE (mode) and - if (TARGET_MACHO) -{ - if (SSE_REGNO_P (regno) && TARGET_SSE) -return true; -} - else -{ - if (TARGET_SSE && SSE_REGNO_P (regno) - && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) -return true; -} + if (TARGET_SSE && SSE_REGNO_P (regno) + && (regno < FIRST_SSE_REG + SSE_REGPARM_MAX)) +return true; it bootstrapped successfully and is in testing at present.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #18 from Mike Stump --- On Sep 6, 2013, at 8:43 AM, howarth at nitro dot med.uc.edu wrote: >* i386.c (ix86_hard_regno_mode_ok): AVX modes are valid only when > >AVX is enabled. llvm has: // The first 8 512-bit vector arguments are passed in ZMM registers. CCIfNotVarArg>>>, just after the sse registers… conceptually, I wonder if gcc is missing that.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #21 from Mike Stump --- Don't know… I'd assume there exists a paper somewhere that says it. :-)
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #20 from Jack Howarth --- (In reply to Iain Sandoe from comment #19) The full commit where this was added to llvm is at http://permalink.gmane.org/gmane.comp.compilers.llvm.cvs/153081 and references http://software.intel.com/en-us/intel-isa-extensions (and I assume http://download-software.intel.com/sites/default/files/319433-015.pdf).
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #19 from Iain Sandoe --- (In reply to Mike Stump from comment #18) > On Sep 6, 2013, at 8:43 AM, howarth at nitro dot med.uc.edu > wrote: > >* i386.c (ix86_hard_regno_mode_ok): AVX modes are valid only when > > > >AVX is enabled. > > llvm has: > > // The first 8 512-bit vector arguments are passed in ZMM registers. > CCIfNotVarArg CCIfSubtarget<"hasAVX512()", > CCAssignToReg<[ZMM0, ZMM1, ZMM2, ZMM3, ZMM4, ZMM5, ZMM6, > ZMM7], > > just after the sse registers… conceptually, I wonder if gcc is missing that. On the basis that clang (Darwin11, Darwin12) defines the ABI - we should see about this. Presumably, this should be disabled for OS versions where gcc-4.2/gcc-4.0 are the "system compiler". As of now, the documentation does not refer to this - the web page still points to the older psABI. Is there an official update to the System V psABI covering these regs?
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 --- Comment #22 from Iain Sandoe --- Author: iains Date: Sat Sep 14 11:09:55 2013 New Revision: 202590 URL: http://gcc.gnu.org/viewcvs?rev=202590&root=gcc&view=rev Log: gcc: PR target/58269 config/i386/i386.c (ix86_function_arg_regno_p): Make Darwin use the xmm register set described in the psABI. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 mrs at gcc dot gnu.org changed: What|Removed |Added Known to work||4.9.0 --- Comment #24 from mrs at gcc dot gnu.org --- Fixed. Thanks fro the report and the fix guys.
[Bug target/58269] [4.9 Regression] ICE when building libobjc on x86_64-apple-darwin* after revision 201915
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58269 mrs at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #23 from mrs at gcc dot gnu.org --- Fixed. Thanks fro the report and the fix guys.