* [PATCH] Fix PR71522
@ 2016-06-14 7:47 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2016-06-14 7:47 UTC (permalink / raw)
To: gcc-patches
I am testing the following to fix PR71522.
Bootstrap / regtest running on x86_64-unknown-linux-gnu.
Richard.
2016-06-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/71522
* tree-ssa.c (non_rewritable_lvalue_p): Do not rewrite non-float
copying into float copying.
* gcc.dg/torture/pr71522.c: New testcase.
Index: gcc/tree-ssa.c
===================================================================
*** gcc/tree-ssa.c (revision 237426)
--- gcc/tree-ssa.c (working copy)
*************** non_rewritable_lvalue_p (tree lhs)
*** 1300,1305 ****
--- 1328,1337 ----
|| (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
&& (TYPE_PRECISION (TREE_TYPE (decl))
>= TYPE_PRECISION (TREE_TYPE (lhs)))))
+ /* Make sure we are not re-writing non-float copying into float
+ copying as that can incur normalization. */
+ && (! FLOAT_TYPE_P (TREE_TYPE (decl))
+ || types_compatible_p (TREE_TYPE (lhs), TREE_TYPE (decl)))
&& (TREE_THIS_VOLATILE (decl) == TREE_THIS_VOLATILE (lhs)))
return false;
Index: gcc/testsuite/gcc.dg/torture/pr71522.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr71522.c (revision 0)
--- gcc/testsuite/gcc.dg/torture/pr71522.c (working copy)
***************
*** 0 ****
--- 1,27 ----
+ /* { dg-do run } */
+
+ #if __SIZEOF_LONG_DOUBLE__ == 16
+ #define STR "AAAAAAAAAAAAAAA"
+ #elif __SIZEOF_LONG_DOUBLE__ == 12
+ #define STR "AAAAAAAAAAA"
+ #elif __SIZEOF_LONG_DOUBLE__ == 8
+ #define STR "AAAAAAA"
+ #elif __SIZEOF_LONG_DOUBLE__ == 4
+ #define STR "AAA"
+ #else
+ #define STR "A"
+ #endif
+
+ int main()
+ {
+ long double d;
+ char s[sizeof d];
+
+ __builtin_memcpy(&d, STR, sizeof d);
+ __builtin_memcpy(&s, &d, sizeof s);
+
+ if (__builtin_strncmp (s, STR, sizeof s) != 0)
+ __builtin_abort ();
+
+ return 0;
+ }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-06-14 7:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-14 7:47 [PATCH] Fix PR71522 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).