diff options
author | Jakub Jelinek <jakub@redhat.com> | 2004-04-13 20:36:16 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2004-04-13 20:36:16 +0000 |
commit | 9c9a219faf2cbb54ac134068ba2cd57b7d697b34 (patch) | |
tree | 6223103d2f371c5c9ed7ddb90f0e52861c749831 | |
parent | 7f3cbaa404cb03cc7ef37038bcab269e9685852a (diff) |
2004-03-04 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/14235
* expr.c (convert_move): Copy the source to a new pseudo
when converting from a sub-word source to a larger-than-word
register which conflicts with the source.
* gcc.c-torture/compile/20040304-1.c: New test.
2004-04-02 Jakub Jelinek <jakub@redhat.com>
PR optimization/13488
* gcc/testsuite/gcc.c-torture/execute/20040402-1.c: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-3_3-rhl-branch@80658 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/expr.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20040402-1.c | 62 |
4 files changed, 84 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fa83043ce1f..8c2bc5db762 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-03-04 Eric Botcazou <ebotcazou@libertysurf.fr> + + PR optimization/14235 + * expr.c (convert_move): Copy the source to a new pseudo + when converting from a sub-word source to a larger-than-word + register which conflicts with the source. + 2004-04-01 Jakub Jelinek <jakub@redhat.com> * config/sparc/sparc.h (FLOATDITF2_LIBCALL, FIX_TRUNCTFDI2_LIBCALL, diff --git a/gcc/expr.c b/gcc/expr.c index c31eba65542..2c46918a15a 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -919,7 +919,11 @@ convert_move (to, from, unsignedp) != CODE_FOR_nothing)) { if (GET_CODE (to) == REG) - emit_insn (gen_rtx_CLOBBER (VOIDmode, to)); + { + if (reg_overlap_mentioned_p (to, from)) + from = force_reg (from_mode, from); + emit_insn (gen_rtx_CLOBBER (VOIDmode, to)); + } convert_move (gen_lowpart (word_mode, to), from, unsignedp); emit_unop_insn (code, to, gen_lowpart (word_mode, to), equiv_code); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a80e7d49f8b..b98ec08e4bd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,13 @@ -2004-04-02 Jakub Jelinek <jakuB@redhat.com> +2004-03-04 Eric Botcazou <ebotcazou@libertysurf.fr> + + * gcc.c-torture/compile/20040304-1.c: New test. + +2004-04-02 Jakub Jelinek <jakub@redhat.com> + + PR optimization/13488 + * gcc/testsuite/gcc.c-torture/execute/20040402-1.c: New test. + +2004-04-02 Jakub Jelinek <jakub@redhat.com> Eric Botcazou <ebotcazou@libertysurf.fr> * gcc.dg/20040302-1.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/20040402-1.c b/gcc/testsuite/gcc.c-torture/execute/20040402-1.c new file mode 100644 index 00000000000..d52e1b6a493 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20040402-1.c @@ -0,0 +1,62 @@ +/* PR optimization/13488 */ +extern void abort (void); +extern void exit (int); + +#ifdef __i386__ +# define regparm __attribute__((regparm (1))) +#else +# define regparm +#endif + +regparm long +ll2c_1 (int a, long long x) +{ + x = (signed char) x; + return x; +} + +regparm long +ll2c_2 (int a, long long x) +{ + return (signed char) x; +} + +regparm long +ll2s_1 (int a, long long x) +{ + x = (short) x; + return x; +} + +regparm long +ll2s_2 (int a, long long x) +{ + return (short) x; +} + +regparm long +ll2i_1 (int a, long long x) +{ + x = (int) x; + return x; +} + +regparm long +ll2i_2 (int a, long long x) +{ + return (int) x; +} + +int +main (void) +{ + long long a; + for (a = 0LL; a < 100000000000LL; a += 10000001000LL) + { + if (ll2c_1 (0, a) != ll2c_2 (0, a) + || ll2s_1 (0, a) != ll2s_2 (0, a) + || ll2i_1 (0, a) != ll2i_2 (0, a)) + abort (); + } + exit (0); +} |