Re: Add __builtin_tgmath for better tgmath.h implementation (bug 81156)

2017-11-15 Thread Joseph Myers
On Wed, 15 Nov 2017, Richard Biener wrote: > Thanks - I suppose we can't avoid the repeated expansion by sth like > > #define exp(Val) ({ __typeof__ Val tem = Val; __TGMATH_UNARY_REAL_IMAG > (tem, exp, cexp); }) Well, that still expands its argument twice. You'd need to use __auto_type to avoi

Re: Add __builtin_tgmath for better tgmath.h implementation (bug 81156)

2017-11-15 Thread Richard Biener
On Wed, Nov 15, 2017 at 2:54 AM, Joseph Myers wrote: > Various implementations of C99/C11 have the property that > their macro expansions contain many copies of the macro arguments, so > resulting in exponential blowup of the size of macro expansions where > a call to such a macro contains other

Add __builtin_tgmath for better tgmath.h implementation (bug 81156)

2017-11-14 Thread Joseph Myers
Various implementations of C99/C11 have the property that their macro expansions contain many copies of the macro arguments, so resulting in exponential blowup of the size of macro expansions where a call to such a macro contains other such calls in the macro arguments. This patch adds a (C-only)