public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PTR-PLUS] Fix the last known C++ regression except for libmudflap (at  least on i686-linux-gnu)
@ 2007-05-13  2:08 Andrew_Pinski
  0 siblings, 0 replies; only message in thread
From: Andrew_Pinski @ 2007-05-13  2:08 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

Hi,
  The problem here is two fold (well it can be solved using either method 
but both are nice cleanups and should be done either way).  First when 
expand_expr_addr_expr_1, with modifier  being EXPAND_INITIALIZER, it tries 
to expand the offset via expand_expr but only with EXPAND_NORMAL which is 
wrong.  Second the code for expanding INTEGER_CST, forces the value to a 
register if we have an overflow, this is now not needed that fold ignores 
the overflow.

Committed to the branch after a bootstrap/test on i686-linux-gnu with no 
regressions.

Thanks,
Andrew Pinski

ChangeLog:

        * expr.c (expand_expr_addr_expr_1): Call expand_expr
        for the offset with the modifier as EXPAND_INITIALIZER
        if the modifier is EXPAND_INITIALIZER.
        (expand_expr_real_1 <case INTEGER_CST>): Don't force to
        a register if we had an overflow.


[-- Attachment #2: fixlastC++.diff.txt --]
[-- Type: text/plain, Size: 1213 bytes --]

Index: gcc/expr.c
===================================================================
--- gcc/expr.c	(revision 124625)
+++ gcc/expr.c	(working copy)
@@ -6630,7 +6630,8 @@ expand_expr_addr_expr_1 (tree exp, rtx t
 
       if (modifier != EXPAND_NORMAL)
 	result = force_operand (result, NULL);
-      tmp = expand_expr (offset, NULL, tmode, EXPAND_NORMAL);
+      tmp = expand_expr (offset, NULL, tmode,
+			 modifier == EXPAND_INITIALIZER ? EXPAND_INITIALIZER : EXPAND_NORMAL);
 
       result = convert_memory_address (tmode, result);
       tmp = convert_memory_address (tmode, tmp);
@@ -7053,15 +7054,6 @@ expand_expr_real_1 (tree exp, rtx target
       temp = immed_double_const (TREE_INT_CST_LOW (exp),
 				 TREE_INT_CST_HIGH (exp), mode);
 
-      /* ??? If overflow is set, fold will have done an incomplete job,
-	 which can result in (plus xx (const_int 0)), which can get
-	 simplified by validate_replace_rtx during virtual register
-	 instantiation, which can result in unrecognizable insns.
-	 Avoid this by forcing all overflows into registers.  */
-      if (TREE_OVERFLOW (exp)
-	  && modifier != EXPAND_INITIALIZER)
-	temp = force_reg (mode, temp);
-
       return temp;
 
     case VECTOR_CST:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-13  2:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-13  2:08 [PTR-PLUS] Fix the last known C++ regression except for libmudflap (at least on i686-linux-gnu) Andrew_Pinski

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).