diff options
author | Jan-Benedict Glaw <jbglaw@gcc.gnu.org> | 2013-09-20 19:00:02 +0000 |
---|---|---|
committer | Jan-Benedict Glaw <jbglaw@gcc.gnu.org> | 2013-09-20 19:00:02 +0000 |
commit | 7691132c9150044474afd3634f69a48bd558ea42 (patch) | |
tree | 539eddc3834c93117f1ffe77c311662e330f8763 | |
parent | bd599dea43ec7cc7b68ec87a6b493aaf3c595589 (diff) | |
download | gcc-7691132c9150044474afd3634f69a48bd558ea42.zip gcc-7691132c9150044474afd3634f69a48bd558ea42.tar.gz gcc-7691132c9150044474afd3634f69a48bd558ea42.tar.bz2 |
Work around buggy gas not properly sign-extending a 64bit value on a 32bit host
PR target/56875
2013-09-20 Martin Husemann <martin@NetBSD.org>
Jan-Benedict Glaw <jbglaw@lug-owl.de>
gcc/
* config/vax/vax.c (vax_output_int_move): Use D format specifier.
* config/vax/vax.md (ashldi3, <unnamed>): Ditto.
gcc/testsuite/
* gcc.target/vax/vax.exp: New.
* gcc.target/vax/pr56875.c: Ditto.
From-SVN: r202796
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/vax/vax.c | 4 | ||||
-rw-r--r-- | gcc/config/vax/vax.md | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/vax/pr56875.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/vax/vax.exp | 41 |
6 files changed, 70 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 31f26b1..d4f56a4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-09-20 Martin Husemann <martin@NetBSD.org> + + PR target/56875 + * config/vax/vax.c (vax_output_int_move): Use D format specifier. + * config/vax/vax.md (ashldi3, <unnamed>): Ditto. + 2013-09-20 Richard Biener <rguenther@suse.de> PR middle-end/58484 diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 53189a7..6b643d1 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -1187,7 +1187,7 @@ vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, { operands[1] = GEN_INT (lval); operands[2] = GEN_INT (n); - return "ashq %2,%1,%0"; + return "ashq %2,%D1,%0"; } #if HOST_BITS_PER_WIDE_INT == 32 } @@ -1199,7 +1199,7 @@ vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, { operands[1] = GEN_INT (hval >> n); operands[2] = GEN_INT (n + 32); - return "ashq %2,%1,%0"; + return "ashq %2,%D1,%0"; #endif } } diff --git a/gcc/config/vax/vax.md b/gcc/config/vax/vax.md index eadde18..2c05d00 100644 --- a/gcc/config/vax/vax.md +++ b/gcc/config/vax/vax.md @@ -697,14 +697,14 @@ (ashift:DI (match_operand:DI 1 "general_operand" "g") (match_operand:QI 2 "general_operand" "g")))] "" - "ashq %2,%1,%0") + "ashq %2,%D1,%0") (define_insn "" [(set (match_operand:DI 0 "nonimmediate_operand" "=g") (ashiftrt:DI (match_operand:DI 1 "general_operand" "g") (neg:QI (match_operand:QI 2 "general_operand" "g"))))] "" - "ashq %2,%1,%0") + "ashq %2,%D1,%0") ;; We used to have expand_shift handle logical right shifts by using extzv, ;; but this make it very difficult to do lshrdi3. Since the VAX is the diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e7acce4..cef626a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-09-20 Jan-Benedict Glaw <jbglaw@lug-owl.de> + + PR target/56875 + * gcc.target/vax/vax.exp: New. + * gcc.target/vax/pr56875.c: Ditto. + 2013-09-20 Richard Biener <rguenther@suse.de> PR middle-end/58484 diff --git a/gcc/testsuite/gcc.target/vax/pr56875.c b/gcc/testsuite/gcc.target/vax/pr56875.c new file mode 100644 index 0000000..f409afe --- /dev/null +++ b/gcc/testsuite/gcc.target/vax/pr56875.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ +/* { dg-final { scan-assembler "ashq .*,\\\$0xffffffffffffffff," } } */ +/* { dg-final { scan-assembler-not "ashq .*,\\\$-1," } } */ + +void +a (void) +{ + unsigned long i = 1; + unsigned long long v; + + v = ~ (unsigned long long) 0 << i; +} diff --git a/gcc/testsuite/gcc.target/vax/vax.exp b/gcc/testsuite/gcc.target/vax/vax.exp new file mode 100644 index 0000000..2aec4ee --- /dev/null +++ b/gcc/testsuite/gcc.target/vax/vax.exp @@ -0,0 +1,41 @@ +# Copyright (C) 2013 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't a VAX target. +if ![istarget vax-*-*] then { + return +} + +# Load support procs. +load_lib gcc-dg.exp + +# If a testcase doesn't have special options, use these. +global DEFAULT_CFLAGS +if ![info exists DEFAULT_CFLAGS] then { + set DEFAULT_CFLAGS " -ansi -pedantic-errors" +} + +# Initialize `dg'. +dg-init + +# Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ + "" $DEFAULT_CFLAGS + +# All done. +dg-finish |