This is the mail archive of the gcc@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: Optimizing away deletion of null pointers with g++


Hi,

On 16/08/2017 12:09, Daniel Langr wrote:
When compiling the following code:

int* ptr = nullptr;
delete ptr;
I didn't understand why we don't already handle the easy case:

constexpr int* ptr = nullptr;
delete ptr;

and the below tiny front-end tweak would take care of it. But I'm not sure how much of that we want in the front-end, I would appreaciate a word from Jason about such kind of early optimization.

Thanks,
Paolo.

////////////////

Attachment: p
Description: Text document


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