The fix to PR50730 (revision 180367 - http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180367) causes the test gcc.c-torture/unsorted/dilayout.c to ICE at -O3. A reduced test case is: $ cat test.c /* arm-none-eabi-gcc -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=soft -O3 test.c */ struct ii { int a; int b; }; struct foo { int a; struct ii ab; }; struct ii foo (int *p, struct foo a) { p[0] = a.a; p[1] = a.ab.a; } /* end of test.c. */ $ arm-none-eabi-gcc -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=soft -O3 test.c test.c: In function 'foo': test.c:15:11: internal compiler error: in expand_insn, at optabs.c:7693 -fno-tree-vectorize causes the issue to go away. The issue still exists in revision 180524
I see this too, but I don't think it's my patch's fault. I reverted it and the reduced test still failed. The patch makes no difference for this basic block - it gets vectorized with or without it.
(In reply to comment #1) > I see this too, but I don't think it's my patch's fault. I reverted it and the > reduced test still failed. The patch makes no difference for this basic block - > it gets vectorized with or without it. Apologies if I've miss labelled this issue - git bisect suggested that r180367 was where the issue was introduced. I will take another look this afternoon to see if I misread the output and it was another check-in nearby.
We need to tweak maybe_legitimize_operand_same_code (thanks Ramana for the heads-up). Testing a fix.
Author: rsandifo Date: Mon Dec 12 15:18:24 2011 New Revision: 182244 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182244 Log: gcc/ PR middle-end/50873 * optabs.c (maybe_legitimize_operand_same_code): Use copy_to_mode_reg instead of force_reg. Do nothing if the address is already a non-virtual pseudo register. Modified: trunk/gcc/ChangeLog trunk/gcc/optabs.c
Fixed on trunk.