Created attachment 38738 [details] reduce test case that ice There is a rule in the 'gcc internals' document that states that 'enabled' attribute must not depend on the current insn operands. But unfortunately such a dependency exists due to 'use_literal_pool' attribute dependency on operands[1] and 'use_literal_pool' usage in 'enabled' attribute definition (see arm.md). This leads to ice on check_bool_attrs() assertion in recog.c that exactly checks that 'enabled', 'preferred_for_size' or 'preferred_for_speed' are static properties of the subtarget (as stated in gcc internals document and in check_bool_attrs() comment). Find attached a test case that triggers this ice. >> arm-none-eabi-gcc -c simple.c -mslow-flash-data -O0 -mfloat-abi=hard -march=armv7-m -mthumb -mfpu=vfpv3 will trigger an ice whereas >> arm-none-eabi-gcc -c simple.c -mno-slow-flash-data -O0 -mfloat-abi=hard -march=armv7-m -mthumb -mfpu=vfpv3 will not. Mickael
Created attachment 38739 [details] ice backtrace
Confirned, doesn't ICE on 4.9
I have a patch for this but it has not had much testing so far. It also includes code to fix -mslow-flash-data with floating-point constants. I'll see to split the patch in two as testing the integer part should be simpler. Best regards.
(In reply to Thomas Preud'homme from comment #3) Thomas, I am seeing that the assignee name has been reset : does it mean that you definitely disengage from looking at this problem ? If this is the case, and if nobody officially takes over, would you share your current patch ? Best regards, --C
(In reply to Christophe Monat from comment #4) > (In reply to Thomas Preud'homme from comment #3) > > Thomas, Hi Christophe, > > I am seeing that the assignee name has been reset : does it mean that you > definitely disengage from looking at this problem ? Yes but only because a colleague took over. He is trying a new approach for -mslow-flash-data altogether which should prove cleaner. > > If this is the case, and if nobody officially takes over, would you share > your current patch ? I'd prefer not since my colleague Andre took over and is actively working on it. He'll keep this bug updated of any progress. Best regards, Thomas
Ticket is currently unassigned
Got a patch up for review on gcc-patches that fixes this, see https://gcc.gnu.org/ml/gcc-patches/2016-10/msg00377.html
Author: avieira Date: Mon Dec 5 17:36:03 2016 New Revision: 243266 URL: https://gcc.gnu.org/viewcvs?rev=243266&root=gcc&view=rev Log: [ARM] PR71607: New approach to arm_disable_literal_pool gcc/ChangeLog.arm: 2016-12-05 Andre Vieira <andre.simoesdiasvieira@arm.com> PR target/71607 * config/arm/arm.md (use_literal_pool): Removes. (64-bit immediate split): No longer takes cost into consideration if 'arm_disable_literal_pool' is enabled. * config/arm/arm.c (arm_use_blocks_for_constant_p): New. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Define. (arm_max_const_double_inline_cost): Remove use of arm_disable_literal_pool. * config/arm/vfp.md (no_literal_pool_df_immediate): New. (no_literal_pool_sf_immediate): New. gcc/testsuite/ChangeLog.arm: 2016-12-05 Andre Vieira <andre.simoesdiasvieira@arm.com> Thomas Preud'homme <thomas.preudhomme@arm.com> PR target/71607 * gcc.target/arm/thumb2-slow-flash-data.c: Renamed to ... * gcc.target/arm/thumb2-slow-flash-data-1.c: ... this. * gcc.target/arm/thumb2-slow-flash-data-2.c: New. * gcc.target/arm/thumb2-slow-flash-data-3.c: New. * gcc.target/arm/thumb2-slow-flash-data-4.c: New. * gcc.target/arm/thumb2-slow-flash-data-5.c: New. Added: branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-1.c branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-2.c branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-3.c branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-4.c branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-5.c Removed: branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data.c Modified: branches/ARM/embedded-6-branch/gcc/ChangeLog.arm branches/ARM/embedded-6-branch/gcc/config/arm/arm.c branches/ARM/embedded-6-branch/gcc/config/arm/arm.md branches/ARM/embedded-6-branch/gcc/config/arm/vfp.md branches/ARM/embedded-6-branch/gcc/testsuite/ChangeLog.arm
*** Bug 79237 has been marked as a duplicate of this bug. ***
(In reply to Ramana Radhakrishnan from comment #9) Hello Ramana, Is there a plan to have this patch delivered upstream at some point in the near future ? Best regards, --C
(In reply to Christophe Monat from comment #10) > (In reply to Ramana Radhakrishnan from comment #9) > > Hello Ramana, > > Is there a plan to have this patch delivered upstream at some point in the > near future ? > > Best regards, > --C Hi Christophe, We're working on a fix for this. We'll keep you updated on the progress. Thanks, Tejas.
(In reply to Christophe Monat from comment #10) > (In reply to Ramana Radhakrishnan from comment #9) > > Hello Ramana, > > Is there a plan to have this patch delivered upstream at some point in the > near future ? > > Best regards, > --C Hi Christophe, The patch has now been posted to the mailing list: https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00872.html Regards, Prakhar
(In reply to Prakhar Bahuguna from comment #12) Hi Prakar, > The patch has now been posted to the mailing list: > https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00872.html Thanks for the work, and the kind notification. I really have high hopes that it will be accepted soon (Ramana, could you please...?), since I am getting high internal pressure to have it fixed, to move forward to deliver our own work. --C
Author: thopre01 Date: Fri May 5 15:41:28 2017 New Revision: 247640 URL: https://gcc.gnu.org/viewcvs?rev=247640&root=gcc&view=rev Log: [ARM] PR71607: Fix ICE when loading constant 2017-05-05 Andre Vieira <andre.simoesdiasvieira@arm.com> Prakhar Bahuguna <prakhar.bahuguna@arm.com> gcc/ PR target/71607 * config/arm/arm.md (use_literal_pool): Remove. (64-bit immediate split): No longer takes cost into consideration if arm_disable_literal_pool is enabled. * config/arm/arm.c (arm_tls_referenced_p): Add diagnostic if TLS is used when arm_disable_literal_pool is enabled. (arm_max_const_double_inline_cost): Remove use of arm_disable_literal_pool. (push_minipool_fix): Add assert. (arm_reorg): Add return if arm_disable_literal_pool is enabled. * config/arm/vfp.md (no_literal_pool_df_immediate): New. (no_literal_pool_sf_immediate): New. 2017-05-05 Andre Vieira <andre.simoesdiasvieira@arm.com> Thomas Preud'homme <thomas.preudhomme@arm.com> Prakhar Bahuguna <prakhar.bahuguna@arm.com> gcc/testsuite/ PR target/71607 * gcc.target/arm/thumb2-slow-flash-data.c: Renamed to ... * gcc.target/arm/thumb2-slow-flash-data-1.c: ... this. * gcc.target/arm/thumb2-slow-flash-data-2.c: New. * gcc.target/arm/thumb2-slow-flash-data-3.c: New. * gcc.target/arm/thumb2-slow-flash-data-4.c: New. * gcc.target/arm/thumb2-slow-flash-data-5.c: New. * gcc.target/arm/tls-disable-literal-pool.c: New. Added: trunk/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-1.c - copied, changed from r247638, trunk/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data.c trunk/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-2.c trunk/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-3.c trunk/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-4.c trunk/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-5.c trunk/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c Removed: trunk/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/arm/arm.c trunk/gcc/config/arm/arm.md trunk/gcc/config/arm/vfp.md trunk/gcc/testsuite/ChangeLog
Author: prakhar Date: Fri Jun 2 11:19:16 2017 New Revision: 248822 URL: https://gcc.gnu.org/viewcvs?rev=248822&root=gcc&view=rev Log: PR71607: Fix ICE when loading constant 2017-06-02 Prakhar Bahuguna <prakhar.bahuguna@arm.com> Backport from mainline 2017-05-05 Andre Vieira <andre.simoesdiasvieira@arm.com> Prakhar Bahuguna <prakhar.bahuguna@arm.com> gcc/ PR target/71607 * config/arm/arm.md (use_literal_pool): Remove. (64-bit immediate split): No longer takes cost into consideration if arm_disable_literal_pool is enabled. * config/arm/arm.c (arm_tls_referenced_p): Add diagnostic if TLS is used when arm_disable_literal_pool is enabled. (arm_max_const_double_inline_cost): Remove use of arm_disable_literal_pool. (push_minipool_fix): Add assert. (arm_reorg): Add return if arm_disable_literal_pool is enabled. * config/arm/vfp.md (no_literal_pool_df_immediate): New. (no_literal_pool_sf_immediate): New. 2017-05-05 Andre Vieira <andre.simoesdiasvieira@arm.com> Thomas Preud'homme <thomas.preudhomme@arm.com> Prakhar Bahuguna <prakhar.bahuguna@arm.com> gcc/testsuite/ PR target/71607 * gcc.target/arm/thumb2-slow-flash-data.c: Renamed to ... * gcc.target/arm/thumb2-slow-flash-data-1.c: ... this. * gcc.target/arm/thumb2-slow-flash-data-2.c: New. * gcc.target/arm/thumb2-slow-flash-data-3.c: New. * gcc.target/arm/thumb2-slow-flash-data-4.c: New. * gcc.target/arm/thumb2-slow-flash-data-5.c: New. * gcc.target/arm/tls-disable-literal-pool.c: New. Added: branches/gcc-7-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-2.c branches/gcc-7-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-3.c branches/gcc-7-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-4.c branches/gcc-7-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-5.c branches/gcc-7-branch/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/config/arm/arm.c branches/gcc-7-branch/gcc/config/arm/arm.md branches/gcc-7-branch/gcc/config/arm/vfp.md branches/gcc-7-branch/gcc/testsuite/ChangeLog
Author: thopre01 Date: Mon Jun 19 15:01:11 2017 New Revision: 249372 URL: https://gcc.gnu.org/viewcvs?rev=249372&root=gcc&view=rev Log: PR71607: Fix ICE when loading constant 2017-06-19 Prakhar Bahuguna <prakhar.bahuguna@arm.com> Backport from mainline 2017-05-05 Andre Vieira <andre.simoesdiasvieira@arm.com> Prakhar Bahuguna <prakhar.bahuguna@arm.com> gcc/ PR target/71607 * config/arm/arm.md (use_literal_pool): Remove. (64-bit immediate split): No longer takes cost into consideration if arm_disable_literal_pool is enabled. * config/arm/arm.c (arm_tls_referenced_p): Add diagnostic if TLS is used when arm_disable_literal_pool is enabled. (arm_max_const_double_inline_cost): Remove use of arm_disable_literal_pool. (push_minipool_fix): Add assert. (arm_reorg): Add return if arm_disable_literal_pool is enabled. * config/arm/vfp.md (no_literal_pool_df_immediate): New. (no_literal_pool_sf_immediate): New. gcc/testsuite/ PR target/71607 * gcc.target/arm/thumb2-slow-flash-data.c: Renamed to ... * gcc.target/arm/thumb2-slow-flash-data-1.c: ... this. * gcc.target/arm/thumb2-slow-flash-data-2.c: New. * gcc.target/arm/thumb2-slow-flash-data-3.c: New. * gcc.target/arm/thumb2-slow-flash-data-4.c: New. * gcc.target/arm/thumb2-slow-flash-data-5.c: New. * gcc.target/arm/tls-disable-literal-pool.c: New. Added: branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/tls-disable-literal-pool.c Modified: branches/ARM/embedded-6-branch/gcc/ChangeLog.arm branches/ARM/embedded-6-branch/gcc/config/arm/arm.c branches/ARM/embedded-6-branch/gcc/config/arm/vfp.md branches/ARM/embedded-6-branch/gcc/testsuite/ChangeLog.arm branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-2.c branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-3.c branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-4.c branches/ARM/embedded-6-branch/gcc/testsuite/gcc.target/arm/thumb2-slow-flash-data-5.c
GCC 5 branch is being closed
I believe this should now be fixed for 7.2+.
GCC 6 branch is being closed, fixed in 7.x.