This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix i386 bootstrap (PR bootstrap/41324)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Sep 2009 15:49:12 +0200
- Subject: [PATCH] Fix i386 bootstrap (PR bootstrap/41324)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
Since the recent convert_modes change i386-linux doesn't bootstrap -
tree-ssa-math-opts.c is miscompiled by stage1 gcc, when
convert_modes (DImode, DImode, (const_int -1), 1)
incorrectly returns
(const_double 0xffffffff) instead of the right
(const_int -1) (aka 0xffffffffffffffff).
The following patch fixes it, we only want to do that if we are actually
widening mode.
Bootstrapped/regtested on i686-linux, ok for trunk?
2009-09-10 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/41324
* expr.c (convert_modes): Only zero extend in the 2xHWI mode
case if widening.
--- gcc/expr.c.jj 2009-09-10 09:09:27.000000000 +0200
+++ gcc/expr.c 2009-09-10 14:19:45.000000000 +0200
@@ -769,7 +769,8 @@ convert_modes (enum machine_mode mode, e
if (unsignedp && GET_MODE_CLASS (mode) == MODE_INT
&& GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_WIDE_INT
- && CONST_INT_P (x) && INTVAL (x) < 0)
+ && CONST_INT_P (x) && INTVAL (x) < 0
+ && GET_MODE_BITSIZE (mode) > GET_MODE_BITSIZE (oldmode))
{
HOST_WIDE_INT val = INTVAL (x);
Jakub