* [PATCH[2/n] Remove GENERIC stmt combining from SCCVN
@ 2015-06-25 13:19 Richard Biener
2015-06-26 7:57 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2015-06-25 13:19 UTC (permalink / raw)
To: gcc-patches
This shows up in gcc.dg/tree-ssa/reassoc-13.c where the 'reassoc:'
case in fold_binary happily handles floats if flag_associative_math.
Thus here, too.
Bootstrap & regtest ongoing on x86_64-unknown-linux-gnu.
Richard.
2015-06-25 Richard Biener <rguenther@suse.de>
* match.pd: Allow associating FLOAT_TYPE_P when flag_associative_math.
Index: gcc/match.pd
===================================================================
--- gcc/match.pd (revision 224893)
+++ gcc/match.pd (working copy)
@@ -561,9 +578,10 @@ (define_operator_list swapped_tcc_compar
&& !TYPE_OVERFLOW_SANITIZED (type))
(convert @1)))
- /* We can't reassociate floating-point or fixed-point plus or minus
- because of saturation to +-Inf. */
- (if (!FLOAT_TYPE_P (type) && !FIXED_POINT_TYPE_P (type))
+ /* We can't reassociate floating-point unless -fassociative-math
+ or fixed-point plus or minus because of saturation to +-Inf. */
+ (if ((!FLOAT_TYPE_P (type) || flag_associative_math)
+ && !FIXED_POINT_TYPE_P (type))
/* Match patterns that allow contracting a plus-minus pair
irrespective of overflow issues. */
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH[2/n] Remove GENERIC stmt combining from SCCVN
2015-06-25 13:19 [PATCH[2/n] Remove GENERIC stmt combining from SCCVN Richard Biener
@ 2015-06-26 7:57 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-06-26 7:57 UTC (permalink / raw)
To: gcc-patches
On Thu, 25 Jun 2015, Richard Biener wrote:
>
> This shows up in gcc.dg/tree-ssa/reassoc-13.c where the 'reassoc:'
> case in fold_binary happily handles floats if flag_associative_math.
> Thus here, too.
>
> Bootstrap & regtest ongoing on x86_64-unknown-linux-gnu.
Applied with the additional
* gfortran.dg/reassoc_3.f90: Adjust.
Index: gcc/testsuite/gfortran.dg/reassoc_3.f90
===================================================================
--- gcc/testsuite/gfortran.dg/reassoc_3.f90 (revision 224938)
+++ gcc/testsuite/gfortran.dg/reassoc_3.f90 (working copy)
@@ -14,5 +14,4 @@ function test(a)
end
! { dg-final { scan-tree-dump "b = 5" "original" } }
-! { dg-final { scan-tree-dump "c_. = .a" "optimized" } }
-! { dg-final { scan-tree-dump "return c_.;" "optimized" } }
+! { dg-final { scan-tree-dump-times " = " 1 "optimized" } }
> Richard.
>
> 2015-06-25 Richard Biener <rguenther@suse.de>
>
> * match.pd: Allow associating FLOAT_TYPE_P when flag_associative_math.
>
> Index: gcc/match.pd
> ===================================================================
> --- gcc/match.pd (revision 224893)
> +++ gcc/match.pd (working copy)
> @@ -561,9 +578,10 @@ (define_operator_list swapped_tcc_compar
> && !TYPE_OVERFLOW_SANITIZED (type))
> (convert @1)))
>
> - /* We can't reassociate floating-point or fixed-point plus or minus
> - because of saturation to +-Inf. */
> - (if (!FLOAT_TYPE_P (type) && !FIXED_POINT_TYPE_P (type))
> + /* We can't reassociate floating-point unless -fassociative-math
> + or fixed-point plus or minus because of saturation to +-Inf. */
> + (if ((!FLOAT_TYPE_P (type) || flag_associative_math)
> + && !FIXED_POINT_TYPE_P (type))
>
> /* Match patterns that allow contracting a plus-minus pair
> irrespective of overflow issues. */
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nuernberg)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-26 7:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-25 13:19 [PATCH[2/n] Remove GENERIC stmt combining from SCCVN Richard Biener
2015-06-26 7:57 ` Richard Biener
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).