public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR79894
@ 2017-03-06 12:01 Richard Biener
  2017-03-06 12:05 ` Thomas Koenig
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2017-03-06 12:01 UTC (permalink / raw)
  To: gcc-patches; +Cc: fortran


The Fortran FE creates non-1:1 type compatible complex-expr / 
realpart-expr in this case and thus like other FEs it can't expect
fold to end up with 1:1 type compatible results.

Testing on x86_64-unknown-linux-gnu in progress.

Ok for trunk?

Thanks,
Richard.

2017-03-06  Richard Biener  <rguenther@suse.de>

	PR fortran/79894
	* trans.c (gfc_add_modify_loc): Weaken assert.

Index: gcc/fortran/trans.c
===================================================================
--- gcc/fortran/trans.c	(revision 245913)
+++ gcc/fortran/trans.c	(working copy)
@@ -151,11 +151,11 @@ gfc_add_modify_loc (location_t loc, stmt
   tree t1, t2;
   t1 = TREE_TYPE (rhs);
   t2 = TREE_TYPE (lhs);
-  /* Make sure that the types of the rhs and the lhs are the same
+  /* Make sure that the types of the rhs and the lhs are compatible
      for scalar assignments.  We should probably have something
      similar for aggregates, but right now removing that check just
      breaks everything.  */
-  gcc_checking_assert (t1 == t2
+  gcc_checking_assert (TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2)
 		       || AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
 
   tmp = fold_build2_loc (loc, MODIFY_EXPR, void_type_node, lhs,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix PR79894
  2017-03-06 12:01 [PATCH] Fix PR79894 Richard Biener
@ 2017-03-06 12:05 ` Thomas Koenig
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Koenig @ 2017-03-06 12:05 UTC (permalink / raw)
  To: Richard Biener, gcc-patches; +Cc: fortran

Am 06.03.2017 um 13:01 schrieb Richard Biener:
>
> The Fortran FE creates non-1:1 type compatible complex-expr /
> realpart-expr in this case and thus like other FEs it can't expect
> fold to end up with 1:1 type compatible results.
>
> Testing on x86_64-unknown-linux-gnu in progress.
>
> Ok for trunk?

Ok.

Thanks for the patch!

Regards

	Thomas

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-06 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-06 12:01 [PATCH] Fix PR79894 Richard Biener
2017-03-06 12:05 ` Thomas Koenig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).