PR fortran/60341
* frontend-passes.c (optimize_comparison): Guard two union
accesses with the corresponding tag checks.
testsuite/
PR fortran/60341
* gfortran.dg/str_comp_optimize_1.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@208259
138bc75d-0d04-0410-961f-
82ee72b054a4
+2014-03-02 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/60341
+ * frontend-passes.c (optimize_comparison): Guard two union accesses
+ with the corresponding tag checks.
+
2014-02-22 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/59599
/* Replace A // B < A // C with B < C, and A // B < C // B
with A < C. */
if (op1->ts.type == BT_CHARACTER && op2->ts.type == BT_CHARACTER
+ && op1->expr_type == EXPR_OP
&& op1->value.op.op == INTRINSIC_CONCAT
+ && op2->expr_type == EXPR_OP
&& op2->value.op.op == INTRINSIC_CONCAT)
{
gfc_expr *op1_left = op1->value.op.op1;
+2014-03-02 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/60341
+ * gfortran.dg/str_comp_optimize_1.f90: New test.
+
2014-02-26 Fabien ChĂȘne <fabien@gcc.gnu.org>
- PR c++/37140
- * g++.dg/template/using27.C: New.
- * g++.dg/template/using28.C: New.
- * g++.dg/template/using29.C: New.
+ PR c++/37140
+ * g++.dg/template/using27.C: New.
+ * g++.dg/template/using28.C: New.
+ * g++.dg/template/using29.C: New.
2014-02-22 Mikael Morin <mikael@gcc.gnu.org>
--- /dev/null
+! { dg-do compile }
+! { dg-options "-ffrontend-optimize" }
+!
+! PR fortran/60341
+! An unguarded union access was wrongly enabling a frontend optimization on a
+! string comparison, leading to an ICE.
+!
+! Original testcase from Steve Chapel <steve.chapel@a2pg.com>.
+! Reduced by Steven G. Kargl <kargl@gcc.gnu.org>.
+!
+
+ subroutine modelg(ncm)
+ implicit none
+ integer, parameter :: pc = 30, pm = pc - 1
+ integer i
+ character*4 catt(pm,2)
+ integer ncm,iatt(pm,pc)
+ do i=1,ncm
+ if (catt(i,1)//catt(i,2).eq.'central') exit
+ end do
+ iatt(i,4)=1
+ end