From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: drepper@cygnus.com (Ulrich Drepper) Cc: egcs@cygnus.com Subject: Re: internal error asm Date: Tue, 24 Feb 1998 05:07:00 -0000 Message-id: <28608.888305519@hurl.cygnus.com> References: X-SW-Source: 1998-02/msg01112.html In message < r2iuq6ggb9.fsf@happy.cygnus.com >you write: > Hi, > > the following little piece of code crashed all gcc versions on ix86 > which I could test: > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > #include > > extern double bar (double); > > int > baz (double d) > { > double e = bar (d); > #ifdef BROKEN > asm volatile ("" : : : "st"); > #else > asm volatile ("" : : : "memory"); > #endif > return printf ("%lg\n", e); > } Thanks. It's an x86 specific failure (dies in reg-stack...) Can you test this patch (both to make sure it fixes the abort *and* that it doesn't obviously screw up the code -- there's some question in my mind about what is the proper thing to do in this case. Index: reg-stack.c =================================================================== RCS file: /egcs/carton/cvsfiles/egcs/./gcc/reg-stack.c,v retrieving revision 1.8 diff -c -3 -p -r1.8 reg-stack.c *** reg-stack.c 1998/02/13 05:40:28 1.8 --- reg-stack.c 1998/02/24 07:28:42 *************** constrain_asm_operands (n_operands, oper *** 605,610 **** --- 605,615 ---- int n_alternatives; int j; + /* If the ASM has no operands, then it must either be alternative zero + or "-1" for no alternative matches. ??? Which is correct? */ + if (n_operands == 0) + return 0; + for (j = 0; j < n_operands; j++) constraints[j] = operand_constraints[j];