summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 06:52:17 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-04 06:52:17 +0000
commit8877d71a364fccd5906ab847e78e8244d30b3d9a (patch)
treebe14a3bf22a53b73725aac6854d2bfd28e23731e /gcc/testsuite/gcc.dg
parent7872a8f0b1373ac91b66309a2d7641cc4b2bffdf (diff)
downloadgcc-8877d71a364fccd5906ab847e78e8244d30b3d9a.tar.gz
PR optimization/10876
* config/sparc/sparc.h (CONST_OK_FOR_LETTER): Add new 'O' constraint for constant 4096. (CONST_DOUBLE_OK_FOR_LETTER_P): Likewise. * config/sparc/sparc.md (adddi3 expander): Canonicalize pattern. Do not transform into MINUS insn for constant 4096. (*adddi3_sp64 insn): Canonicalize pattern. Add new alternative for constant 4096 as third operand. (addsi3 expander): Remove. (*addsi3 insn): Rename into 'addsi3'. Canonicalize pattern. Add new alternative for constant 4096 as third operand. (subdi3 expander): Do not transform into PLUS insn for constant 4096. (*subdi3_sp64 insn): Add new alternative for constant 4096 as third operand. (subsi3 expander): Remove. (*subsi3 insn): Rename into 'subsi3'. Add new alternative for constant 4096 as third operand. * doc/md.texi (Machine Constraints): Document new 'O' constraint for the SPARC port. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67426 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/sparc-constant-1.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/sparc-constant-1.c b/gcc/testsuite/gcc.dg/sparc-constant-1.c
new file mode 100644
index 00000000000..bb4b1bce4f8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/sparc-constant-1.c
@@ -0,0 +1,12 @@
+/* PR optimization/10876 */
+/* { dg-do compile { target sparc*-*-* } } */
+
+/* Verify that adding the constant 4096 is turned
+ into substracting the constant -4096. */
+
+int foo(int a)
+{
+ return a+4096;
+}
+
+/* { dg-final { scan-assembler "sub" } } */