From 29847ec4952258319a397b4a567dc31f942aac5c Mon Sep 17 00:00:00 2001 From: krebbel Date: Wed, 12 Dec 2007 09:15:03 +0000 Subject: [PATCH] 2007-12-12 Andreas Krebbel * config/s390/s390.c (s390_O_constraint_str): Limit the range for 'On' to -4G+1..-1. * config/s390/constraints.md: Adjust comment accordingly. 2007-12-12 Andreas Krebbel * gcc.target/s390/20071212-1.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130787 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/s390/constraints.md | 4 ++-- gcc/config/s390/s390.c | 3 +-- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/s390/20071212-1.c | 11 +++++++++++ 5 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.target/s390/20071212-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 111ed01..cab09cb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-12-12 Andreas Krebbel + + * config/s390/s390.c (s390_O_constraint_str): Limit the range + for 'On' to -4G+1..-1. + * config/s390/constraints.md: Adjust comment accordingly. + 2007-12-11 Nathan Sidwell * config/rs6000/rs6000.c (rs6000_emit_prologue): Use frame_reg_rtx diff --git a/gcc/config/s390/constraints.md b/gcc/config/s390/constraints.md index cdafa2f..92fd325 100644 --- a/gcc/config/s390/constraints.md +++ b/gcc/config/s390/constraints.md @@ -49,7 +49,7 @@ ;; O -- Multiple letter constraint followed by 1 parameter. ;; s: Signed extended immediate value (-2G .. 2G-1). ;; p: Positive extended immediate value (0 .. 4G-1). -;; n: Negative extended immediate value (-4G .. -1). +;; n: Negative extended immediate value (-4G+1 .. -1). ;; These constraints do not accept any operand if the machine does ;; not provide the extended-immediate facility. ;; P -- Any integer constant that can be loaded without literal pool. @@ -337,7 +337,7 @@ (define_constraint "On" "@internal - Negative extended immediate value (-4G .. -1). + Negative extended immediate value (-4G+1 .. -1). This constraint will only match if the machine provides the extended-immediate facility." (and (match_code "const_int") diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index f7d80db..0b6d63b 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -2056,8 +2056,7 @@ s390_O_constraint_str (const char c, HOST_WIDE_INT value) || s390_single_part (GEN_INT (value), DImode, SImode, 0) == 1; case 'n': - return value == -1 - || s390_single_part (GEN_INT (value), DImode, SImode, -1) == 1; + return s390_single_part (GEN_INT (value - 1), DImode, SImode, -1) == 1; default: gcc_unreachable (); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e6c5b41..85cd1e3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-12-12 Andreas Krebbel + + * gcc.target/s390/20071212-1.c: New testcase. + 2007-12-11 Jakub Jelinek PR c++/34238 diff --git a/gcc/testsuite/gcc.target/s390/20071212-1.c b/gcc/testsuite/gcc.target/s390/20071212-1.c new file mode 100644 index 0000000..e5d05ad --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/20071212-1.c @@ -0,0 +1,11 @@ +/* This used to fail due to bug in the On constraint causing a slgfi + to be emitted with an immediate not fitting into 32bit. */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z9-109" } */ + +long +foo (long a) +{ + return a - (1ULL << 32); +} -- 2.7.4