Created attachment 37999 [details] reduced e_hypot.c Hello, We are running into an ICE in lra on trunk when compiling newlib for an ARM thumb1 target with -Os. This happens when compiling newlib/libm/math/e_hypot.c See the attached reduced source and the error when executing the command below: $arm-none-eabi-gcc -march=armv4t -mthumb -Os -S besttry.c The error: besttry.c: In function '__ieee754_hypot': besttry.c:27:1: internal compiler error: in lra_create_new_reg_with_unique_value, at lra.c:188 } ^ 0x94d30b lra_create_new_reg_with_unique_value(machine_mode, rtx_def*, reg_class, char const*) ../src/gcc/lra.c:188 0x94d358 lra_create_new_reg(machine_mode, rtx_def*, reg_class, char const*) ../src/gcc/lra.c:228 0x9590e4 split_reg ../src/gcc/lra-constraints.c:5034 0x95a2da split_if_necessary ../src/gcc/lra-constraints.c:5142 0x95e08c inherit_in_ebb ../src/gcc/lra-constraints.c:5527 0x95e08c lra_inheritance() ../src/gcc/lra-constraints.c:5813 0x950900 lra(_IO_FILE*) ../src/gcc/lra.c:2312 0x9082d1 do_reload ../src/gcc/ira.c:5408 0x9082d1 execute ../src/gcc/ira.c:5592 My initial investigation into lra shows that this is due to split_reg calling lra_create_new_reg with mode = VOIDmode. Others with more lra experience might be able to spot the origin of the issue quicker though. A bisect shows that this seems to be introduced with revision r234184 where reg split now calls lra_create_new_reg with 'mode' that seems to be set by 'lra_reg_info[hard_regno].biggest_mode' which in our case will be SImode. This mode is passed down to lra_create_new_reg_with_unique_value which asserts if its not VOIDmode. Cheers, Andre PS: Unrelated to this, the code in lra_create_new_reg_with_unique_value looks a bit odd, I think mode should have been initialized with VOIDmode there.
confirmed.
Author: bernds Date: Fri Mar 18 19:09:08 2016 New Revision: 234342 URL: https://gcc.gnu.org/viewcvs?rev=234342&root=gcc&view=rev Log: Fix PR70278, a problem with the previous split_reg change PR rtl-optimization/70278 * lra-constraints.c (split_reg): Handle the case where biggest_mode is VOIDmode. testsuite/ * gcc.dg/torture/pr70278.c: New test. * gcc.target/arm/pr70278.c: New test. Added: trunk/gcc/testsuite/gcc.dg/torture/pr70278.c trunk/gcc/testsuite/gcc.target/arm/pr70278.c Modified: trunk/gcc/ChangeLog trunk/gcc/lra-constraints.c trunk/gcc/testsuite/ChangeLog
This fixes it on our end. Thank you Bernd. Marking this as RESOLVED FIXED.