This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[arm] truncate immediate constants


The arm insv pattern was building immediate constants without truncating them 
to SImode.  Amongst other things was causing gcc.c-torture/execute/930621-1.c 
to fail on armeb-none-eabi.

The attached patch fixed this.

Tested with cross to arm-none-eabi.
Applied to mainline and csl-arm-branch.

Paul

2004-01-20  Paul Brook  <paul@codesourcery.com>

 * config/arm/arm.md (insv): Use gen_int_mode.
Index: arm.md
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/config/arm/arm.md,v
retrieving revision 1.145.2.28
diff -u -p -r1.145.2.28 arm.md
--- arm.md	13 Oct 2004 12:49:29 -0000	1.145.2.28
+++ arm.md	20 Jan 2005 19:38:57 -0000
@@ -1793,7 +1793,7 @@
 
 	emit_insn (gen_andsi3 (op1, operands[0], GEN_INT (~mask2)));
 	emit_insn (gen_iorsi3 (subtarget, op1,
-			       GEN_INT (op3_value << start_bit)));
+			       gen_int_mode (op3_value << start_bit, SImode)));
       }
     else if (start_bit == 0
 	     && !(const_ok_for_arm (mask)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]