]> gcc.gnu.org Git - gcc.git/commit
middle-end/101480 - overloaded global new/delete
authorRichard Biener <rguenther@suse.de>
Mon, 11 Oct 2021 14:06:03 +0000 (16:06 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 8 Nov 2021 12:35:12 +0000 (13:35 +0100)
commit19dcea67ac40cfdeb396fa264ebbe04fbe61fdc0
tree5bf0cee922dc7f88fde663b77e79224ec250da68
parent580d66f5a0bdcd88dcdab2d4ace3bbbaae121af3
middle-end/101480 - overloaded global new/delete

The following fixes the issue of ignoring side-effects on memory
from overloaded global new/delete operators by not marking them
as effectively 'const' apart from other explicitely specified
side-effects.

This will cause

FAIL: g++.dg/warn/Warray-bounds-16.C  -std=gnu++1? (test for excess errors)

because we now no longer statically see the initialization loop
never executes because the call to operator new can now clobber 'a.m'.
This seems to be an issue with the warning code and/or ranger so
I'm leaving this FAIL to be addressed as followup.

2021-10-11  Richard Biener  <rguenther@suse.de>

PR middle-end/101480
* gimple.c (gimple_call_fnspec): Do not mark operator new/delete
as const.

* g++.dg/torture/pr10148.C: New testcase.

(cherry picked from commit 09a0affdb0598a54835ac4bb0dd6b54122c12916)
gcc/gimple.c
gcc/testsuite/g++.dg/torture/pr10148.C [new file with mode: 0644]
This page took 0.057317 seconds and 5 git commands to generate.