This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] new testcase: copyprop on structs
- From: Dan Nicolaescu <dann at ics dot uci dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 06 Nov 2003 12:41:27 -0800
- Subject: [tree-ssa] new testcase: copyprop on structs
1 test showing that copyprop does not work on structs.
This is probably a known issue, but it would be good to have some
tests in the testsuite.
It wasn't clear which optimization should have taken care of
this so the scan is done on the final .optimized dump.
If approved, please check it in, I don't have commit access.
2003-11-06 Dan Nicolaescu <dann@ics.uci.edu>
* gcc.dg/tree-ssa/20031106-6.c: New test.
*** /dev/null Thu Apr 11 07:25:15 2002
--- gcc/testsuite/gcc.dg/tree-ssa/20031106-6.c Thu Nov 6 10:50:49 2003
***************
*** 0 ****
--- 1,28 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O1 -fdump-tree-optimized" } */
+
+ extern void link_error (void);
+
+ /* Check for copyprop on structs. */
+
+ struct s
+ {
+ char d;
+ int a, b;
+ double m;
+ };
+
+ struct s foo (struct s r)
+ {
+ struct s temp_struct1;
+ struct s temp_struct2;
+ struct s temp_struct3;
+ temp_struct1 = r;
+ temp_struct2 = temp_struct1;
+ temp_struct3 = temp_struct2;
+ return temp_struct3;
+ }
+
+ /* There should be no references to any of "temp_struct*"
+ temporaries. */
+ /* { dg-final { scan-tree-dump-times "temp_struct" 0 "optimized"} } */