[cfe-dev] Fwd: external function codegen bug

Eli Friedman eli.friedman at gmail.com
Fri May 23 16:26:09 PDT 2008


On Fri, May 23, 2008 at 9:12 AM, Chris Lattner <clattner at apple.com> wrote:
>>> buggy code:
>>>
>>> extern double g ();
>>> void f()
>>> {
>>> double t, g();
>>> t = g();
>>> }
> One approach would be to have two predicates: one for "real i-c-e" and one
> for "gcc i-c-e".  If it is a GCC ICE but not a standards one, accept but
> emit a diagnostic?  In this case, it is pretty easy, in other cases (such as
> when dealing with ?: promotion rules) it is much harder.
>
> I don't know if it is worth it though.  The set of stuff accepted by GCC is,
> uh, "poorly defined".
>
> -Chris

Wrong thread?

In reply to what you're saying though, I think it isn't worth it
unless it turns out to be a common construct, because it's difficult
to contain all the effects of deciding something is a "gcc i-c-e";
this case is easy, but stuff starts getting more complicated fast.
Besides, once/if we start properly supporting FP rounding modes, we
can actually end up with wrong code.

-Eli



More information about the cfe-dev mailing list