This is the mail archive of the 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: [PATCH] Remove also 2nd argument for unused delete operator (PR tree-optimization/91270).

On Sun, Jul 28, 2019 at 4:57 PM Martin Liška <> wrote:
> Hi.
> And there's one more patch that deals with delete operator
> which has a second argument (size). That definition GIMPLE
> statement of the size must be also properly marked.
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> Ready to be installed?

This isn't a proper fix.  You can't mark a random operand as necessary
during elimination - this only works in very constraint cases.  Here
it will break down if the stmt you just marked depends on another stmt
only used by the stmt you just marked (and thus also not necessary).

The fix is to propagate_necessity where you either have to excempt
the two-operator delete from handling or to mark its second operand
as necessary despite eventually deleting the call.  You can avoid
this in case the allocation function used the exact same size argument.


> Thanks,
> Martin

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