http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28501

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|mark at codesourcery dot    |jason at gcc dot gnu.org,
                   |com, mmitchel at gcc dot    |paolo.carlini at oracle dot
                   |gnu.org                     |com
      Known to fail|                            |

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-03 
15:48:01 UTC ---
Hi Jason. A small issue which I fixed a few days ago reminded me this one,
pretty old, on which I worked a bit two years ago, then left alone...

At the time I figured out the below patchlet, which still avoids the ICE,
passes the testsuite, and apparently provides a sensible semantics (eg, if the
operator returns 1, i is initialized to 1; if the testcase is tweaked to use
__imag__, i is initialized to 0).

What do you think? Or shall we just reject the snippet?

Index: call.c
===================================================================
--- call.c      (revision 173309)
+++ call.c      (working copy)
@@ -2586,6 +2586,12 @@ add_builtin_candidate (struct z_candidate **candid
         types are TYPE2.  */
       break;

+    case REALPART_EXPR:
+    case IMAGPART_EXPR:
+      if (ARITHMETIC_TYPE_P (type1))
+       break;
+      return;
+ 
     default:
       gcc_unreachable ();
     }

Reply via email to