[v3] Library bits of c++/49813

Pat Haugen pthaugen@linux.vnet.ibm.com
Thu Jul 28 21:00:00 GMT 2011


On 07/28/2011 04:43 AM, Paolo Carlini wrote:
>> /usr/local/gcc/gcc-20110728/Build/ia64-suse-linux/libstdc++-v3/include/cmath:
>> In function 'constexpr float std::fma(float, float, float)':
>> /usr/local/gcc/gcc-20110728/Build/ia64-suse-linux/libstdc++-v3/include/cmath:1288:43:
>> sorry, unimplemented: unexpected ast of kind fma_expr
>> /usr/local/gcc/gcc-20110728/Build/ia64-suse-linux/libstdc++-v3/include/cmath:1288:43:
>> internal compiler error: in potential_constant_expression_1, at
>> cp/semantics.c:8094
> in the past we encountered already a few small problems of this kind, with cases
> missing from the potential_constant_expression_1 switch. I believe something
> quite close to what I'm attaching below should be enough, can you give it a try?
>
> In any case, we definitely want Jason to have a look as soon as possible. If you
> want to restore the ia64 bootstrap in the meanwhile, feel free to comment out
> any troublesome constexpr specifier in that file (or replacing it with inline).
>
> Thanks!
> Paolo.
>
> //////////////////////
>
>
>
> p
>
>
> Index: semantics.c
> ===================================================================
> --- semantics.c	(revision 176846)
> +++ semantics.c	(working copy)
> @@ -8057,6 +8057,13 @@ potential_constant_expression_1 (tree t, bool want
>   	  return false;
>         return true;
>
> +    case FMA_EXPR:
> +      for (i = 0; i<  3; ++i)
> +	if (!potential_constant_expression_1 (TREE_OPERAND (t, i),
> +					      true, flags))
> +	  return false;
> +      return true;
> +
>       case COND_EXPR:
>       case VEC_COND_EXPR:
>         /* If the condition is a known constant, we know which of the legs we

I am seeing the same error on PowerPC and the above patch fixes it.

-Pat



More information about the Gcc-patches mailing list