[hjl@gnu-36 gcc]$ cat ../../../../src-trunk/gcc/testsuite/gcc.target/i386/pr38240.c /* { dg-do compile } */ typedef float V __attribute__ ((__vector_size__ (16), __may_alias__)); V __attribute__((target("sse"))) f(const V *ptr) { return *ptr; } V g(const V *ptr) { return *ptr; } [hjl@gnu-36 gcc]$ ../../xgcc -B../../ ../../../../src-trunk/gcc/testsuite/gcc.target/i386/pr38240.c -S -march=i586 -m32 ../../../../src-trunk/gcc/testsuite/gcc.target/i386/pr38240.c: In function ‘g’: ../../../../src-trunk/gcc/testsuite/gcc.target/i386/pr38240.c:8:21: internal compiler error: in convert_move, at expr.c:326 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. [hjl@gnu-36 gcc]$
Well - obviously global typedefs keep their BLKmode. The target attribute can't work this way - it's broken by design.
WONTFIX for an ICE seems a bit odd to me. Just needs a diagnostic to reject nonsense target attributes, or a sorry. But not an ICE.
Well, I think we should back out support for that option. The set of "nonsensical" options doesn't include "sse" - but all options are included in the set of broken options. At least I expect that you can create a testcase with such ICEs for every one.
It is caused by revision 162918: http://gcc.gnu.org/ml/gcc-cvs/2010-08/msg00129.html
(In reply to comment #3) > Well, I think we should back out support for that option. The set of > "nonsensical" options doesn't include "sse" - but all options are included > in the set of broken options. At least I expect that you can create a > testcase with such ICEs for every one. Not every one, just those that expand the set of valid backend modes. Thus "sse3" will not cause additional ice's, assuming "sse2" is in effect globally. That's not to say this feature isn't fraught with peril. I think it should be improved though, not removed.
This is also present on i686-pc-cygwin: > FAIL: gcc.target/i386/pr38240.c (internal compiler error) ICE happens here: (gdb) bt #0 0x006065e0 in convert_move (to=0x7fcc26c0, from=0x7fcc26d0, unsignedp=0) at /gnu/gcc/gcc-unpatched/gcc/expr.c:2944 #1 0x00609d2f in store_expr (exp=0x7fde2c10, target=0x7fcc26c0, call_param_p=0, nontemporal=0 '\0') at /gnu/gcc/gcc-unpatched/gcc/expr.c:2944 #2 0x0060f638 in expand_assignment (to=0x7fe20050, from=0x7fde2c10, nontemporal=0 '\0') at /gnu/gcc/gcc-unpatched/gcc/expr.c:2944 (...yes, the line number info is wrong, don't know why but it's unrelated.) The patch in r162918 tightens up the condition on calling emit_block_move: --- trunk/gcc/expr.c 2010/08/05 15:39:54 162917 +++ trunk/gcc/expr.c 2010/08/05 16:37:38 162918 @@ -4752,11 +4752,14 @@ { int unsignedp = TYPE_UNSIGNED (TREE_TYPE (exp)); if (GET_MODE (target) == BLKmode - || GET_MODE (temp) == BLKmode) + && GET_MODE (temp) == BLKmode) emit_block_move (target, temp, expr_size (exp), (call_param_p ? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL)); + else if (GET_MODE (target) == BLKmode) + store_bit_field (target, INTVAL (expr_size (exp)) * BITS_PER_UNIT, + 0, GET_MODE (temp), temp); else convert_move (target, temp, unsignedp); } so that when temp is BLKmode and target is not, as in this case: (gdb) call debug_rtx (to) # aka target (mem/c/i:V4SF (reg/f:SI 58 [ D.1753 ]) [0 <retval>+0 S16 A128]) (gdb) call debug_rtx (from) # aka temp (mem/c/i:BLK (plus:SI (reg/f:SI 54 virtual-stack-vars) (const_int -16 [0xfffffff0])) [0 D.1747+0 S16 A128]) ... it falls through into the final else clause, and calls convert_move. However convert_move is unable to handle any BLKmode data at all: it has these asserts near the beginning, gcc_assert (to_mode != BLKmode); gcc_assert (from_mode != BLKmode); .. and the second one fires.
*** Bug 45753 has been marked as a duplicate of this bug. ***
Yes, my patch should be a no-op on this failure, it just avoids calling convert_move if it would ICE anyway.
(In reply to comment #1) > Well - obviously global typedefs keep their BLKmode. The target attribute > can't work this way - it's broken by design. If it is broken by design, why not remove it before people start depending on it and GCC has to add layer after layer of workarounds?
Target bug. ix86_valid_target_attribute_p should reject "sse" if that changes the mode of any type. Thus, declaring the testcase as-is invalid. The same issue is at least latent with 4.5, making this P2.
*** Bug 46025 has been marked as a duplicate of this bug. ***
This also breaks lto-bootstrap on i686-pc-cygwin: /gnu/gcc/gcc/libcpp/lex.c: In function ‘search_line_sse2’: /gnu/gcc/gcc/libcpp/lex.c:370:15: internal compiler error: in convert_move, at expr.c:326 In the call to convert_move, we have: to = (reg/v:V16QI 62 [ repl_nl ]) from = (mem/u/c:BLK (reg/f:SI 97) [0 MEM[(const v16qi *)&repl_chars]+0 S16 A128])
Is this going to be fixed for 4.6.0 or should we XFAIL the test? This PR has been open for 5 months now. Rainer
The test is invalid on i[345]86-*-* without also enabling -msse. A fix is to add /* { dg-options "-msse" { target i[345]86-*-* } } */ probably also for x86_64 with -m32. Or simply unconditionally as it is a x86 specific test anyway. A fix for the bug would instead issue a diagnostic.
(In reply to comment #14) > The test is invalid on i[345]86-*-* without also enabling -msse. Does the same apply to libcpp/lex.c? i.e. Is that code invalid unless compiled with -msse2? LTO bootstrap with arch=i686,tune=generic was still broken last time I checked.
On Fri, 28 Jan 2011, davek at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45325 > > --- Comment #15 from Dave Korn <davek at gcc dot gnu.org> 2011-01-28 15:28:33 UTC --- > (In reply to comment #14) > > The test is invalid on i[345]86-*-* without also enabling -msse. > > Does the same apply to libcpp/lex.c? i.e. Is that code invalid unless > compiled with -msse2? LTO bootstrap with arch=i686,tune=generic was still > broken last time I checked. Yes. The code should be #ifdefed out when -msse is not enabled. Richard.
That works. Patch submitted: http://gcc.gnu.org/ml/gcc-patches/2011-01/msg02297.html
Author: ro Date: Mon Jan 31 14:56:31 2011 New Revision: 169440 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169440 Log: PR target/45325 * gcc.target/i386/pr38240.c: Add dg-options "-msse". Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.target/i386/pr38240.c
Author: dnovillo Date: Wed Feb 2 18:11:36 2011 New Revision: 169720 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169720 Log: PR target/45325 * gcc.target/i386/pr38240.c: Add dg-options "-msse". Modified: branches/google/integration/gcc/testsuite/ChangeLog branches/google/integration/gcc/testsuite/gcc.target/i386/pr38240.c
GCC 4.6.0 is being released, adjusting target milestone.
GCC 4.6.1 is being released.
GCC 4.6.2 is being released.
GCC 4.6.3 is being released.
GCC 4.6.4 has been released and the branch has been closed.
The 4.7 branch is being closed, moving target milestone to 4.8.4.
GCC 4.8.4 has been released.
The ICE is gone with r220609 aka PR61925 fix.
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.
GCC 4.9.3 has been released.
Fixed in GCC 5+.