[Bug c++/33025] [4.3 Regression] Wrong calling of placement new with conditionals

2007-08-20 Thread jakub at gcc dot gnu dot org


--- Comment #5 from jakub at gcc dot gnu dot org  2007-08-20 07:54 ---
Subject: Bug 33025

Author: jakub
Date: Mon Aug 20 07:53:58 2007
New Revision: 127639

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=127639
Log:
PR c++/33025
* init.c (build_new_1): Rename placement_var variable to
placement_expr.
Initialize it with save_expr rather than get_temp_regvar.

* g++.dg/init/new23.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/init/new23.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/init.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug c++/33025] [4.3 Regression] Wrong calling of placement new with conditionals

2007-08-20 Thread jakub at gcc dot gnu dot org


--- Comment #6 from jakub at gcc dot gnu dot org  2007-08-20 08:19 ---
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug c++/33025] [4.3 Regression] Wrong calling of placement new with conditionals

2007-08-16 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2007-08-09 09:18:30 |2007-08-16 16:02:42
   date||


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



[Bug c++/33025] [4.3 Regression] Wrong calling of placement new with conditionals

2007-08-09 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2007-08-09 09:18 ---
Because placement new is required to reproduce this bug and the front-end is
where the broken code happens already, then the patch to fix PR 29286 is the
cause.  

The problem is in build_new_1 where we create a temp variable to hold the
placement variable is initialized with the value of the placement new which is
wrong as we don't get that initialization inside the conditional.

You can most likely reduce this testcase further using printf instead of cout
and saying if you call operator() too many times to abort.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||ian at gcc dot gnu dot org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
  GCC build triplet|x86_64-unknown-linux-gnu|
   GCC host triplet|x86_64-unknown-linux-gnu|
 GCC target triplet|x86_64-unknown-linux-gnu|
   Last reconfirmed|-00-00 00:00:00 |2007-08-09 09:18:30
   date||


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



[Bug c++/33025] [4.3 Regression] Wrong calling of placement new with conditionals

2007-08-09 Thread theodore dot papadopoulo at sophia dot inria dot fr


--- Comment #4 from theodore dot papadopoulo at sophia dot inria dot fr  
2007-08-09 12:02 ---
Created an attachment (id=14046)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14046action=view)
A new more minimal test case

The same program was still working with gcc version 4.3.0 20070608
(experimental). This reduces slightly the bug introduction window even though
it looks that Andrew already spotted the exact patch that introduced the bug
(By the way thank's a lot!!).

grenade- /usr/local/gcc-4.3/bin/g++ Bug.C
grenade- /usr/local/gcc-4.3/bin/g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with:
/user/papadop/laptop/home/src/Cvs/Refs/gcc/gcc-svn-ref/trunk/configure
--prefix=/usr/local/gcc-4.3/ --enable-languages=c,c++,fortran
--enable-__cxa_atexit
Thread model: posix
gcc version 4.3.0 20070703 (experimental)
grenade-  ./a.out
Abort

grenade-  g++ Bug.C
grenade- g++ -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
grenade-  ./a.out

grenade- /usr/local/gcc-4.3.old/bin/g++ Bug.C
grenade- /usr/local/gcc-4.3.old/bin/g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with:
/user/papadop/laptop/home/src/Cvs/Refs/gcc/gcc-svn-ref/trunk/configure
--prefix=/usr/local/gcc-4.3/ --enable-languages=c,c++,fortran
--enable-__cxa_atexit
Thread model: posix
gcc version 4.3.0 20070608 (experimental)
grenade- ./a.out


-- 

theodore dot papadopoulo at sophia dot inria dot fr changed:

   What|Removed |Added

  Attachment #14043|0   |1
is obsolete||


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



[Bug c++/33025] [4.3 Regression] Wrong calling of placement new with conditionals

2007-08-09 Thread mmitchel at gcc dot gnu dot org


-- 

mmitchel at gcc dot gnu dot org changed:

   What|Removed |Added

   Priority|P3  |P1


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



[Bug c++/33025] [4.3 Regression] Wrong calling of placement new with conditionals

2007-08-08 Thread pinskia at gcc dot gnu dot org


--- Comment #2 from pinskia at gcc dot gnu dot org  2007-08-08 18:55 ---
data[i] = (i%2==0) ? new(alloc.value()) unsigned(2) :
new(alloc()) unsigned(1);


  D.2395 = value (alloc);
  D.2367 = D.2395;
  D.2396 = operator() (alloc);

unsigned int * D.2367;
  cleanup_point  Unknown tree: expr_stmt
  (void) (D.2367 = value (alloc)) 
;
unsigned int * D.2384;
  cleanup_point  Unknown tree: expr_stmt
  (void) (D.2384 = operator() (alloc)) 
;


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org
   Keywords||wrong-code
Summary|Wrong optimisation  |[4.3 Regression] Wrong
   ||calling of placement new
   ||with conditionals
   Target Milestone|--- |4.3.0


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