This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix i386 bootstrap (PR bootstrap/41324)


On Thu, Sep 10, 2009 at 3:49 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> 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?

Ok.

Thanks,
Richard.

> 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
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]