PR 22051

Jeffrey A Law law@redhat.com
Mon Jul 11 20:16:00 GMT 2005


> > I've got testcases for this bug in the mainline.  Do you want me to
> > install those onto the branch now or wait until after you get 4.0.1
> > out the door?
> 
> Please wait until 4.0.1 is out the door.

Here's the testcases I just checked onto the gcc-4.0 branch (same tests
as the mainline):


-------------- next part --------------
 	* gcc.dg/tree.ssa/pr22051-1.c: New test.
 	* gcc.dg/tree.ssa/pr22051-2.c: New test.
 
Index: gcc.dg/tree-ssa/pr22051-1.c
===================================================================
RCS file: gcc.dg/tree-ssa/pr22051-1.c
diff -N gcc.dg/tree-ssa/pr22051-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc.dg/tree-ssa/pr22051-1.c	11 Jul 2005 20:09:30 -0000
***************
*** 0 ****
--- 1,23 ----
+ /* { dg-do compile }  */
+ /* { dg-options "-O2 -fdump-tree-optimized" }  */
+ 
+ 
+ void *arf ();
+ int
+ foo()
+ {
+   void *p = arf ();
+ 
+   if ((void (*)(void))p != 0)
+     return 1;
+   else
+     return 2;
+ }
+ 
+ /* The cast to a function pointer type must remain after all optimizations
+    are complete so that function pointer canonicalization works on those
+    targets which require it.  */
+ /* { dg-final { scan-tree-dump-times "if \\(\\(void \\(\\*<.*>\\) \\(void\\)\\) p" 1 "optimized" } } */
+ /* { dg-final { cleanup-tree-dump "optimized" } } */
+ 
+ 
Index: gcc.dg/tree-ssa/pr22051-2.c
===================================================================
RCS file: gcc.dg/tree-ssa/pr22051-2.c
diff -N gcc.dg/tree-ssa/pr22051-2.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc.dg/tree-ssa/pr22051-2.c	11 Jul 2005 20:09:30 -0000
***************
*** 0 ****
--- 1,25 ----
+ /* { dg-do compile }  */
+ /* { dg-options "-O2 -fdump-tree-optimized -w" }  */
+ 
+ 
+ 
+ 
+ void *arf ();
+ int
+ foo()
+ {
+   void (*q)(void);
+   int r = q;
+ 
+   if (r != 0)
+     return 1;
+   else
+     return 2;
+ }
+ 
+ /* The cast to an int type must remain after all optimizations are complete
+    so that we do not try to canonicalize a function pointer for the
+    comparison when no such canonicalization is wanted.  */
+ /* { dg-final { scan-tree-dump-times "if \\(\\(int\\) q" 1 "optimized" } } */
+ /* { dg-final { cleanup-tree-dump "optimized" } } */
+ 


More information about the Gcc-patches mailing list