This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] [PR18354] Unary plus as template argument


On Mon, 15 Nov 2004 03:07:02 +0100, "Giovanni Bajo" <giovannibajo@libero.it> wrote:

> Roger Sayle <roger@eyesopen.com> wrote:
>
>> I believe that the real source of the problem is that INTEGER_CSTs
>> should never be wrapped in NON_LVALUE_EXPRs, and indeed this is the
>> only one of the five remaining places in GCC that create
>> NON_LVALUE_EXPR nodes without checking whether it is actually
>> needed or not.
>
> Ah sorry, I had misread this paragraph. Your patch is surely a valid fix, but I
> still prefer mine because it unifies the code for unary minus and plus
> (avoiding duplication), and also removes one use of NON_LVALUE_EXPR. My
> understanding is that we are trying to get rid of it.

I think it's ok to keep it in the C and C++ front ends, so long as it's
removed by gimplification.  Usually we want to strip redundant
NOP/CONVERT_EXPRs, and having a separate tree code allows us to handle this
case differently.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]