The following testcase started ICEing probably with PR50022 change: ./xgcc -B ./ -march=armv7-a -mfloat-abi=hard -O2 rh783334.c rh783334.c: In function ‘bar’: rh783334.c:12:1: internal compiler error: in output_move_double, at config/arm/arm.c:13951 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. /* { dg-do compile } */ /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */ struct S { int s1; void *s2; }; struct T { struct S t1; unsigned long long t2; }; struct S *foo (unsigned long long); struct S * bar (struct S *x) { return foo (((struct T *) x)->t2); }
Created attachment 26394 [details] gcc47-pr51915.patch Untested fix. output_move_double (sometimes intentionally) modifies the operands array, because it returns a pattern that should be emitted by the caller in some cases. But if that is done already when !emit, when just counting the insns, when output_move_double is called with emit=true, we ICE.
Ramana, if this patch looks ok to you, can you please bootstrap/regtest it? Thanks.
Author: jakub Date: Fri Jan 20 19:39:48 2012 New Revision: 183349 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183349 Log: PR target/51915 * config/arm/arm.c (arm_count_output_move_double_insns): Call output_move_double on a copy of operands array. * gcc.target/arm/pr51915.c: New test. Added: trunk/gcc/testsuite/gcc.target/arm/pr51915.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/arm/arm.c trunk/gcc/testsuite/ChangeLog
Fixed.
*** Bug 51659 has been marked as a duplicate of this bug. ***
Author: jye2 Date: Fri Jun 8 08:57:53 2012 New Revision: 188332 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188332 Log: 2012-06-08 Joey Ye <joey.ye@arm.com> Backport r184442 from mainline 2012-02-21 Richard Earnshaw <rearnsha@arm.com> PR target/52294 * thumb2.md (thumb2_shiftsi3_short): Split register and immediate shifts. For register shifts tie operands 0 and 1. (peephole2 for above): Check that register-controlled shifts have suitably tied operands. Backport r183756 from mainline 2012-01-31 Matthew Gretton-Dann <matthew.gretton-dann@arm.com> * config/arm/thumb2.md (thumb2_mov_notscc): Use MVN for true condition. Backport r183349 from mainline 2012-01-20 Jakub Jelinek <jakub@redhat.com> PR target/51915 * config/arm/arm.c (arm_count_output_move_double_insns): Call output_move_double on a copy of operands array. Backport r183095 from mainline 2012-01-11 Matthew Gretton-Dann <matthew.gretton-dann@arm.com> * config/arm/arm.md (mov_notscc): Use MVN for false condition. Backport r182628 from mainline 2011-12-21 Richard Earnshaw <rearnsha@arm.com> PR target/51643 * arm.c (arm_function_ok_for_sibcall): Use DECL_WEAK in previous change. Backport r182621 from mainline 2011-12-21 Richard Earnshaw <rearnsha@arm.com> PR target/51643 * arm.c (arm_function_ok_for_sibcall): Don't try to tailcall a weak function on bare-metal EABI targets. Testsuite: Backport r183349 from mainline 2012-01-20 Jakub Jelinek <jakub@redhat.com> PR target/51915 * gcc.target/arm/pr51915.c: New test. Backport r183095 from mainline 2012-01-11 Matthew Gretton-Dann <matthew.gretton-dann@arm.com> * gcc.c-torture/execute/20120110-1.c: New testcase. Backport r182621 from mainline 2011-12-21 Richard Earnshaw <rearnsha@arm.com> PR target/51643 * gcc.target/arm/sibcall-2.c: New test. Added: branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.c-torture/execute/20120111-1.c branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr51915.c branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/sibcall-2.c Modified: branches/ARM/embedded-4_6-branch/gcc/ChangeLog.arm branches/ARM/embedded-4_6-branch/gcc/config/arm/arm.c branches/ARM/embedded-4_6-branch/gcc/config/arm/arm.md branches/ARM/embedded-4_6-branch/gcc/config/arm/thumb2.md branches/ARM/embedded-4_6-branch/gcc/testsuite/ChangeLog.arm