Comments
Patch
===================================================================
@@ -17576,12 +17576,12 @@ arm_hard_regno_mode_ok (unsigned int reg
&& regno == VFPCC_REGNUM));
if (TARGET_THUMB1)
- /* For the Thumb we only allow values bigger than SImode in
- registers 0 - 6, so that there is always a second low
- register available to hold the upper part of the value.
- We probably we ought to ensure that the register is the
- start of an even numbered register pair. */
- return (ARM_NUM_REGS (mode) < 2) || (regno < LAST_LO_REGNUM);
+ /* For the Thumb we only allow a value bigger than SImode in the
+ lo registers, and we require that the entire value fit in the
+ lo registers. We probably ought to ensure that the register is
+ the start of an even numbered register pair. */
+ return (ARM_NUM_REGS (mode) < 2
+ || regno + ARM_NUM_REGS (mode) - 1 <= LAST_LO_REGNUM);
if (TARGET_HARD_FLOAT && TARGET_MAVERICK
&& IS_CIRRUS_REGNUM (regno))
===================================================================
@@ -0,0 +1,6 @@
+/* PR target/47540 */
+/* { dg-options "-O2 -std=gnu99" } */
+
+extern double f1 (_Complex double);
+extern _Complex double f2 (_Complex double);
+_Complex double f (_Complex double x) { return f1 (x) == 0 ? 0 : f2 (x); }