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] VAX: Use gcc_{assert,unreachable}()


On Wed, Apr 27, 2005 at 09:54:08AM +0100, Nathan Sidwell wrote:

> coincidentally, I'd also got an (untested) patch.  Feel free to use
> this as a starting point. It doesn't use trailing
> 'else gcc_unreachable ()', turning them into switches or pushing an assert
> up into the previous else if clause.

Even better.  Thanks for your work!

> *** config/vax/vax.c	7 Apr 2005 21:44:57 -0000	1.60
> --- config/vax/vax.c	18 Apr 2005 08:37:19 -0000
> *************** vax_float_literal(register rtx c)
> *** 431,442 ****
>     for (i = 0; i < 7; i++)
>       {
>         int x = 1 << i;
>         REAL_VALUE_FROM_INT (s, x, 0, mode);
>   
>         if (REAL_VALUES_EQUAL (r, s))
>   	return 1;
> !       if (!exact_real_inverse (mode, &s))
> ! 	abort ();
>         if (REAL_VALUES_EQUAL (r, s))
>   	return 1;
>       }
> --- 426,438 ----
>     for (i = 0; i < 7; i++)
>       {
>         int x = 1 << i;
> +       bool ok;
>         REAL_VALUE_FROM_INT (s, x, 0, mode);
>   
>         if (REAL_VALUES_EQUAL (r, s))
>   	return 1;
> !       ok = exact_real_inverse (mode, &s);
> !       gcc_assert (ok);
>         if (REAL_VALUES_EQUAL (r, s))
>   	return 1;
>       }

Looks very nice, except this chunk.  When Matt finished his work, your
patch should be imported, with this part fixed.

MfG, JBG

-- 
AWEK microdata GmbH -- Am Wellbach 4 -- 33609 Bielefeld


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