This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix type mis-match in tree-complex (PR 22356)


The problem here is that we are producing a REALPART_EXPR/IMAGPART_EXPR
with the complex type instead of the sub type.
See PR 22368 for the patch which is used to catch this.  This shows up
in the boostrap with that patch while building libgfortran.


OK? Bootstrap and tested on powerpc-darwin with no regressions.


Thanks,
Andrew Pinski

ChangeLog:
	* tree-complex.c (expand_complex_libcall): Produce
	REALPART_EXPR/IMAGPART_EXPR with the correct type.


Attachment: tree-complex.diff.txt
Description: Text document



Testcase:
/* { dg-do compile } */
/* { dg-options "-O2 -std=gnu99" } */
typedef _Complex float GFC_COMPLEX_4;
void product_c4 (GFC_COMPLEX_4 *src, GFC_COMPLEX_4 *dest, int len)
{
  int n;
  GFC_COMPLEX_4 result;
  for (n = 0; n < len; n++, src += 1)
    result *= *src;
  *dest = result;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]