Re: Fix 20020425-1.c

2011-04-23 Thread Richard Guenther
On Sat, Apr 23, 2011 at 1:43 AM, Mike Stump mikest...@comcast.net wrote:
 On Apr 22, 2011, at 2:05 AM, Richard Guenther wrote:
 I think we shouldn't worry about this kind of testsuite fails.

 There are only two testcases in this class.  I'd rather have zero.  How do 
 you propose to fix them?  For some reason, please just ignore the failures in 
 the test suite doesn't seem right to me.  The next best option would be to 
 trim the recursion required by the testcase until it passes.  Do you prefer 
 that solution?

No.  Either we care for the thing the testcase tests or we don't.  I
think we care for it for regular GCC builds, not for -O0 builds.
Thus, invent a way to skip the testcase for -O0 GCC builds and I'll be happy.

Richard.


Re: Fix 20020425-1.c

2011-04-22 Thread Richard Guenther
On Fri, Apr 22, 2011 at 3:40 AM, Mike Stump mikest...@comcast.net wrote:
 Ping?

The patch makes the testcase pointless.  It also makes the AST differ
more from the source form, so I don't think
it's a particularly good idea.

I think we shouldn't worry about this kind of testsuite fails.

Richard.

 On Apr 12, 2011, at 4:36 PM, Mike Stump wrote:

 This fixes 20020425-1.c when the compiler under test is built with -O0 and 
 we're on a machine with an 8 meg stack.

 Ok?

 2011-04-12  Mike Stump  mikest...@comcast.net

       * c-typeck.c (c_finish_if_stmt): Fold result.
       * fold-const.c (fold_ternary_loc): Handle an empty else.

 fold.diffs.txt




Re: Fix 20020425-1.c

2011-04-21 Thread Mike Stump
Ping?

On Apr 12, 2011, at 4:36 PM, Mike Stump wrote:

 This fixes 20020425-1.c when the compiler under test is built with -O0 and 
 we're on a machine with an 8 meg stack.
 
 Ok?
 
 2011-04-12  Mike Stump  mikest...@comcast.net
 
   * c-typeck.c (c_finish_if_stmt): Fold result.
   * fold-const.c (fold_ternary_loc): Handle an empty else.
 
 fold.diffs.txt



Fix 20020425-1.c

2011-04-12 Thread Mike Stump
This fixes 20020425-1.c when the compiler under test is built with -O0 and 
we're on a machine with an 8 meg stack.

Ok?

2011-04-12  Mike Stump  mikest...@comcast.net

* c-typeck.c (c_finish_if_stmt): Fold result.
* fold-const.c (fold_ternary_loc): Handle an empty else.

This fixes 20020425-1.c so that it doesn't fail when the compiler is built with 
-O0. 

2011-04-12  Mike Stump  mikest...@comcast.net

* c-typeck.c (c_finish_if_stmt): Fold result.
* fold-const.c (fold_ternary_loc): Handle an empty else.

Index: fold-const.c
===
--- fold-const.c(revision 1279)
+++ fold-const.c(working copy)
@@ -13260,6 +13260,8 @@
   return NULL_TREE;
 
 case COND_EXPR:
+  if (!op2)
+   return NULL_TREE;
   /* Pedantic ANSI C says that a conditional expression is never an lvalue,
 so all simple results must be passed through pedantic_non_lvalue.  */
   if (TREE_CODE (arg0) == INTEGER_CST)
Index: c-typeck.c
===
--- c-typeck.c  (revision 1279)
+++ c-typeck.c  (working copy)
@@ -8916,8 +8916,7 @@
 suggest explicit braces to avoid ambiguous %else%);
 }
 
-  stmt = build3 (COND_EXPR, void_type_node, cond, then_block, else_block);
-  SET_EXPR_LOCATION (stmt, if_locus);
+  stmt = fold_build3_loc (if_locus, COND_EXPR, void_type_node, cond, 
then_block, else_block);
   add_stmt (stmt);
 }