This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] More optimization tests
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 11 Aug 2003 21:45:48 -0600
- Subject: [tree-ssa] More optimization tests
- Reply-to: law at redhat dot com
Whee.
* gcc.dg/tree-ssa/20030807-10.c: New test.
Index: gcc.dg/tree-ssa/20030807-10.c
===================================================================
RCS file: gcc.dg/tree-ssa/20030807-10.c
diff -N gcc.dg/tree-ssa/20030807-10.c
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- gcc.dg/tree-ssa/20030807-10.c 12 Aug 2003 03:44:20 -0000
***************
*** 0 ****
--- 1,25 ----
+ /* { dg-do compile */
+ /* { dg-options "-O1 -fdump-tree-ssa" } */
+
+
+ extern const unsigned char mode_size[];
+ unsigned int
+ subreg_highpart_offset (outermode, innermode)
+ int outermode, innermode;
+ {
+ unsigned int offset = 0;
+ int difference = (mode_size[innermode] - mode_size[outermode]);
+ if (difference > 0)
+ {
+ offset += difference % (0 ? 8 : 4);
+ offset += difference / 4 * 4;
+ }
+ return offset;
+ }
+
+ /* There should be one mask with the value 3.
+ /* { dg-final { scan-tree-dump-times " \& 3" 1 "ssa"} } */
+
+ /* There should be one right shift by 2 places.
+ /* { dg-final { scan-tree-dump-times " >> 2" 1 "ssa"} } */
+