aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-20 08:31:59 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2006-07-20 08:31:59 +0000
commit2795872ed25e0686756b516d5b7129890692f791 (patch)
tree4ce100535f55f2472a7f08c6caf516e294159081
parentf8f2e4232a98d0e2633d04cd2ddac370965aa4cf (diff)
Backport from mainline:
2006-07-17 Richard Sandiford <richard@codesourcery.com> PR middle-end/28403 * optabs.c (expand_doubleword_shift): Wrap the call to do_compare_rtx_and_jump with NO_DEFER_POP and OK_DEFER_POP. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/csl/sourcerygxx-4_1@115611 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog.csl10
-rw-r--r--gcc/optabs.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr28403.c23
3 files changed, 35 insertions, 0 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl
index 4e6dc7614fa..5bac5ffbf43 100644
--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -1,3 +1,13 @@
+2006-07-20 Richard Sandiford <richard@codesourcery.com>
+
+ Backport from mainline:
+
+ 2006-07-17 Richard Sandiford <richard@codesourcery.com>
+
+ PR middle-end/28403
+ * optabs.c (expand_doubleword_shift): Wrap the call to
+ do_compare_rtx_and_jump with NO_DEFER_POP and OK_DEFER_POP.
+
2006-07-19 Nathan Sidwell <nathan@codesourcery.com>
backport 2006-04-23 David Edelsohn <edelsohn@gnu.org>
diff --git a/gcc/optabs.c b/gcc/optabs.c
index d428b6c7c71..ab025200659 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -805,8 +805,10 @@ expand_doubleword_shift (enum machine_mode op1_mode, optab binoptab,
subword_label = gen_label_rtx ();
done_label = gen_label_rtx ();
+ NO_DEFER_POP;
do_compare_rtx_and_jump (cmp1, cmp2, cmp_code, false, op1_mode,
0, 0, subword_label);
+ OK_DEFER_POP;
if (!expand_superword_shift (binoptab, outof_input, superword_op1,
outof_target, into_target,
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr28403.c b/gcc/testsuite/gcc.c-torture/execute/pr28403.c
new file mode 100644
index 00000000000..8f85ea08505
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr28403.c
@@ -0,0 +1,23 @@
+typedef unsigned long long ull;
+int global;
+
+int __attribute__((noinline))
+foo (int x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8)
+{
+ global = x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8;
+}
+
+ull __attribute__((noinline))
+bar (ull x)
+{
+ foo (1, 2, 1, 3, 1, 4, 1, 5);
+ return x >> global;
+}
+
+int
+main (void)
+{
+ if (bar (0x123456789abcdefULL) != (0x123456789abcdefULL >> 18))
+ abort ();
+ exit (0);
+}