[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2022-01-26 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

Martin Sebor  changed:

   What|Removed |Added

   Assignee|msebor at gcc dot gnu.org  |unassigned at gcc dot 
gnu.org
 Status|ASSIGNED|NEW

--- Comment #20 from Martin Sebor  ---
I'm not working on this anymore.

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2021-05-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2016-06-23 Thread fw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

Florian Weimer  changed:

   What|Removed |Added

   See Also||https://sourceware.org/bugz
   ||illa/show_bug.cgi?id=6527

--- Comment #19 from Florian Weimer  ---
Current (unreleased) glibc usues this:

# define MALLOC_ALIGNMENT   (2 * SIZE_SZ < __alignof__ (long double) \
 ? __alignof__ (long double) : 2 * SIZE_SZ)

So the old bug https://sourceware.org/bugzilla/show_bug.cgi?id=6527 is gone.

To my knowledge, this level of alignment is sufficient to cover max_align_t.

These malloc changes are in principle back-portable, but they are a bit on the
risky side because where the definition of MALLOC_ALIGNMENT changes, malloc
allocation patterns (and eventually RSS usage) are affected.

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2016-04-10 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

--- Comment #18 from Martin Sebor  ---
The link works for me.  An older version of the paper is here:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3396.htm
If that doesn't work for you either try searching for the paper titled Dynamic
memory allocation for over-aligned data by Clark Nelson.

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2016-04-09 Thread mhadji at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

--- Comment #17 from Marios Hadjieleftheriou  ---
(In reply to Martin Sebor from comment #12)
> Confirmed.  As noted in bug 67911, the solution proposed for the next
> version of C++ is the following:
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0035r0.html
> Until it's accepted and implemented, issuing a warning would help users
> avoid the trap.  I happen to be working in this area so I'll see if I can
> come up with something.

The link posted above appears to be broken.

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2016-04-08 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

Martin Sebor  changed:

   What|Removed |Added

 CC||mhadji at gmail dot com

--- Comment #16 from Martin Sebor  ---
*** Bug 70603 has been marked as a duplicate of this bug. ***

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2016-03-29 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

Martin Sebor  changed:

   What|Removed |Added

 CC||b7.10110111 at gmail dot com

--- Comment #15 from Martin Sebor  ---
*** Bug 70441 has been marked as a duplicate of this bug. ***

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2016-01-30 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

Martin Sebor  changed:

   What|Removed |Added

 CC||ilja.honkonen at helsinki dot 
fi

--- Comment #14 from Martin Sebor  ---
*** Bug 60202 has been marked as a duplicate of this bug. ***

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2016-01-12 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

H.J. Lu  changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu.org

--- Comment #13 from H.J. Lu  ---
*** Bug 69250 has been marked as a duplicate of this bug. ***

[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2015-10-10 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-10-10
 Ever confirmed|0   |1

--- Comment #12 from Martin Sebor  ---
Confirmed.  As noted in bug 67911, the solution proposed for the next version
of C++ is the following:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0035r0.html
Until it's accepted and implemented, issuing a warning would help users avoid
the trap.  I happen to be working in this area so I'll see if I can come up
with something.


[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2015-10-10 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

Martin Sebor  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #11 from Martin Sebor  ---
*** Bug 67911 has been marked as a duplicate of this bug. ***


[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2012-07-15 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

 CC||hayim at post dot tau.ac.il

--- Comment #10 from H.J. Lu hjl.tools at gmail dot com 2012-07-15 13:54:21 
UTC ---
*** Bug 53970 has been marked as a duplicate of this bug. ***


[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2011-06-29 Thread hjl.tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

 CC||sergey.v.maslov at intel
   ||dot com

--- Comment #9 from H.J. Lu hjl.tools at gmail dot com 2011-06-30 04:50:54 
UTC ---
*** Bug 49585 has been marked as a duplicate of this bug. ***


[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2010-04-23 Thread hjl dot tools at gmail dot com


--- Comment #8 from hjl dot tools at gmail dot com  2010-04-24 02:42 ---
*** Bug 43874 has been marked as a duplicate of this bug. ***


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||edwintorok at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159



[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2009-01-08 Thread hjl dot tools at gmail dot com


--- Comment #7 from hjl dot tools at gmail dot com  2009-01-09 01:09 ---
We can solve it with

1. A target should define MALLOC_ABI_ALIGNMENT properly.
2. g++ should issue an error when the default new operator
is used on a type whose alignment is greater than
MALLOC_ABI_ALIGNMENT.
3. It is user's responsibility to provide a new operator to return
a properly aligned memory.
4. g++ can assume memory return by the user-provided new
operator is properly aligned.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||xuepeng dot guo at intel dot
   ||com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159



[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2008-05-07 Thread joseph at codesourcery dot com


--- Comment #6 from joseph at codesourcery dot com  2008-05-07 11:25 ---
Subject: Re:  C++ compiler should issue a warning with  missing
 new operator

On Wed, 7 May 2008, pinskia at gcc dot gnu dot org wrote:

 aligned memory.  PPC LV2 returns 16byte aligned memory.  PPC Linux should be
 returning 16byte aligned memory for the 128bit long double but from what I
 remember or last heard does not.

There is a patch for that glibc bug 
http://sourceware.org/ml/libc-alpha/2007-11/msg00062.html, but the glibc 
maintainers have not reviewed it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159



[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2008-05-06 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2008-05-06 16:11 ---
Actually we (Sony) have come up with a solution but not much as come about with
it though.

If you read Trevor's proposal, you would have found we did come up with one.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159



[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2008-05-06 Thread hjl dot tools at gmail dot com


--- Comment #2 from hjl dot tools at gmail dot com  2008-05-06 16:28 ---
Trevor, can you scale down your original proposal just to issue an
error when there is no class-specific operator new for a type with
an alignment greater than what malloc() guarantees? It will be
programmer's responsibility to provide appropriate new operator.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||tsmigiel at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159



[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2008-05-06 Thread bangerth at dealii dot org


--- Comment #3 from bangerth at dealii dot org  2008-05-07 04:21 ---
How is the compiler supposed to know about what alignment malloc can
produce? How can it know that ::operator new doesn't increase the
alignment automatically?

W.


-- 

bangerth at dealii dot org changed:

   What|Removed |Added

 CC||bangerth at dealii dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159



[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2008-05-06 Thread hjl dot tools at gmail dot com


--- Comment #4 from hjl dot tools at gmail dot com  2008-05-07 04:56 ---
The default new operator is implemented within gcc. It should be
possible to let g++ know the alignment returned by the new operator.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159



[Bug c++/36159] C++ compiler should issue a warning with missing new operator

2008-05-06 Thread pinskia at gcc dot gnu dot org


--- Comment #5 from pinskia at gcc dot gnu dot org  2008-05-07 05:00 ---
(In reply to comment #4)
 The default new operator is implemented within gcc. It should be
 possible to let g++ know the alignment returned by the new operator.

The default one is but the user can override it as defined by the C++ standard.
 Also different OS's return different alignment.  Mac OS X (darwin) returns the
16 byte alignment on both PowerPC and x86.  While x86 Linux returns 8 byte
aligned memory.  PPC LV2 returns 16byte aligned memory.  PPC Linux should be
returning 16byte aligned memory for the 128bit long double but from what I
remember or last heard does not.

-- Pinski


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36159