Sep 9 change in gen_lowpart_common causes aborts

Bernd Schmidt crux@Pool.Informatik.RWTH-Aachen.DE
Wed Sep 30 07:02:00 GMT 1998


The following change

Wed Sep  9 23:31:36 1998  (Stephen L Moshier) <moshier@world.std.com>

        * emit-rtl.c (gen_lowpart_common): Disable optimization of
        initialized float-int union if the value is a NaN.

causes current egcs snapshots to abort when trying to compile the 
math tests in glibc-2.0.96 (on i586-linux).  Below is a small test
program that demonstrates the problem.  Basically, reload encounters
a SUBREG:SF of a SImode pseudo that is equivalent to a CONST_INT and
aborts in find_reloads_toplev because gen_lowpart doesn't handle it
anymore.
I can't really say what a correct fix would be, since I don't know
why the above change was necessary.


Bernd

static void
foo (float a)
{
}

int sum;
void
bar ()
{
    union {
	unsigned __l __attribute__((__mode__(__SI__)));
	float __d;
    } x  = { __l: 0x7fc00000UL };
    int a,b,c,d,e,f,g,h;
    foo (x.__d);
    for (a = 0; a < 2; a++)
    for (b = 0; b < 2; b++)
    for (c = 0; c < 2; c++)
    for (d = 0; d < 2; d++)
    for (e = 0; e < 2; e++)
    for (f = 0; f < 2; f++)
    for (g = 0; g < 2; g++)
    for (h = 0; h < 2; h++)
		    sum++;
    foo (x.__d);
}



More information about the Gcc-bugs mailing list