This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR71526
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 14 Jun 2016 15:46:01 +0200 (CEST)
- Subject: [PATCH] Fix PR71526
- Authentication-results: sourceware.org; auth=none
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2016-06-14 Richard Biener <rguenther@suse.de>
PR middle-end/71526
* genmatch.c (expr::gen_transform): Use in_type for comparisons
if available.
* gfortran.dg/pr71526.f90: New testcase.
Index: gcc/genmatch.c
===================================================================
*** gcc/genmatch.c (revision 237426)
--- gcc/genmatch.c (working copy)
*************** expr::gen_transform (FILE *f, int indent
*** 2288,2295 ****
{
/* comparisons use boolean_type_node (or what gets in), but
their operands need to figure out the types themselves. */
! sprintf (optype, "boolean_type_node");
! type = optype;
}
else if (*opr == COND_EXPR
|| *opr == VEC_COND_EXPR)
--- 2288,2301 ----
{
/* comparisons use boolean_type_node (or what gets in), but
their operands need to figure out the types themselves. */
! if (in_type)
! type = in_type;
! else
! {
! sprintf (optype, "boolean_type_node");
! type = optype;
! }
! in_type = NULL;
}
else if (*opr == COND_EXPR
|| *opr == VEC_COND_EXPR)
Index: gcc/testsuite/gfortran.dg/pr71526.f90
===================================================================
*** gcc/testsuite/gfortran.dg/pr71526.f90 (revision 0)
--- gcc/testsuite/gfortran.dg/pr71526.f90 (working copy)
***************
*** 0 ****
--- 1,21 ----
+ ! { dg-do link }
+ ! { dg-require-effective-target lto }
+ ! { dg-options "-O2 -flto" }
+
+ MODULE util
+ INTERFACE sort
+ MODULE PROCEDURE sort_cv
+ END INTERFACE
+ CONTAINS
+ SUBROUTINE sort_cv ( arr, n, index )
+ CHARACTER(LEN=*), INTENT(INOUT) :: arr(1:n)
+ INTEGER, INTENT(OUT) :: INDEX(1:n)
+ INTEGER, ALLOCATABLE, DIMENSION(:, :) :: entries
+ ALLOCATE(entries(max_length,SIZE(arr)))
+ END SUBROUTINE sort_cv
+ END MODULE util
+ USE util
+ INTEGER, ALLOCATABLE :: ind(:)
+ character(len=3), ALLOCATABLE :: d(:)
+ CALL sort(d,N,ind)
+ END