[Bug fortran/29410] [Optimization] bug with TRANSFER() and -O2
--- Comment #2 from pinskia at gcc dot gnu dot org 2006-10-29 22:15 --- The problem is that gfc_conv_intrinsic_transfer does *(int*)&float_var which causes a violation of aliasing rules. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added GCC target triplet|powerpc-apple-darwin7 | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29410
[Bug fortran/29410] [Optimization] bug with TRANSFER() and -O2
--- Comment #3 from pinskia at gcc dot gnu dot org 2006-10-29 22:36 --- Here is the fix which I am testing right now: Index: trans-intrinsic.c === --- trans-intrinsic.c (revision 118159) +++ trans-intrinsic.c (working copy) @@ -2914,7 +2914,7 @@ gfc_conv_intrinsic_array_transfer (gfc_s /* Scalar transfer statement. - TRANSFER (source, mold) = *(typeof *)&source. */ + TRANSFER (source, mold) = VIEW_CONVERT_EXPR >source. */ static void gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr) @@ -2939,9 +2939,9 @@ gfc_conv_intrinsic_transfer (gfc_se * se arg = arg->next; type = gfc_typenode_for_spec (&expr->ts); - ptr = convert (build_pointer_type (type), ptr); if (expr->ts.type == BT_CHARACTER) { + ptr = convert (build_pointer_type (type), ptr); gfc_init_se (&argse, NULL); gfc_conv_expr (&argse, arg->expr); gfc_add_block_to_block (&se->pre, &argse.pre); @@ -2951,7 +2951,8 @@ gfc_conv_intrinsic_transfer (gfc_se * se } else { - se->expr = build_fold_indirect_ref (ptr); + tree tmp = build_fold_indirect_ref (ptr); + se->expr = fold_build1 (VIEW_CONVERT_EXPR, type, tmp); } } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29410
[Bug fortran/29410] [Optimization] bug with TRANSFER() and -O2
--- Comment #4 from pinskia at gcc dot gnu dot org 2006-10-30 16:15 --- Subject: Bug 29410 Author: pinskia Date: Mon Oct 30 16:15:09 2006 New Revision: 118186 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118186 Log: 2006-10-30 Andrew Pinski <[EMAIL PROTECTED]> PR fortran/29410 * trans-intrinsic.c (gfc_conv_intrinsic_array_transfer): Change over to create VIEW_CONVERT_EXPR instead of using an ADDR_EXPR, a cast and then an indirect reference 2006-10-30 Andrew Pinski <[EMAIL PROTECTED]> PR Fortran/29410 * gfortran.fortran-torture/execute/transfer1.f90: New test. Added: trunk/gcc/testsuite/gfortran.fortran-torture/execute/transfer1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-intrinsic.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29410
[Bug fortran/29410] [Optimization] bug with TRANSFER() and -O2
--- Comment #1 from fxcoudert at gcc dot gnu dot org 2006-10-18 20:50 --- Confirmed, and Andrew will soon have a patch for this. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot |dot org |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29410
[Bug fortran/29410] [Optimization] bug with TRANSFER() and -O2
-- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2006-10-18 20:50:31 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29410