public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Fix oversight in tuplification of DOM
@ 2011-06-28 21:50 Eric Botcazou
  2011-06-28 22:18 ` Jeff Law
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eric Botcazou @ 2011-06-28 21:50 UTC (permalink / raw)
  To: gcc-patches

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

Hi,

the attached testcase triggers an ICE when compiled at -O or above, on all the 
open branches.  This is a regression introduced with the tuplification.  The 
problem is that 2 ARRAY_RANGE_REFs are recognized as equivalent, although they 
don't have the same number of elements.  This is so because their type isn't 
taken into account by the hash equality function as it simply isn't recorded 
in initialize_hash_element (GIMPLE_SINGLE_RHS case).  Now in all the other 
cases it is recorded so this very likely is an oversight.

Tested on x86_64-suse-linux, OK for all branches?


2011-06-28  Eric Botcazou  <ebotcazou@adacore.com>

	* tree-ssa-dom.c (initialize_hash_element): Fix oversight.


2011-06-28  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/opt17.ad[sb]: New test.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-diff, Size: 448 bytes --]

Index: tree-ssa-dom.c
===================================================================
--- tree-ssa-dom.c	(revision 175408)
+++ tree-ssa-dom.c	(working copy)
@@ -214,6 +214,7 @@ initialize_hash_element (gimple stmt, tr
         {
         case GIMPLE_SINGLE_RHS:
 	  expr->kind = EXPR_SINGLE;
+	  expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
 	  expr->ops.single.rhs = gimple_assign_rhs1 (stmt);
 	  break;
         case GIMPLE_UNARY_RHS:

[-- Attachment #3: opt17.adb --]
[-- Type: text/x-adasrc, Size: 196 bytes --]

-- { dg-do compile }
-- { dg-options "-O" }

package body Opt17 is

  function Func return S is
    V : String (1 .. 6);
  begin
    V (1 .. 3) := "ABC";
    return V (1 .. 5);
  end;

end Opt17;

[-- Attachment #4: opt17.ads --]
[-- Type: text/x-adasrc, Size: 89 bytes --]

package Opt17 is

  subtype S is String (1 .. 5);

  function Func return S;

end Opt17;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-30 19:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-28 21:50 [patch] Fix oversight in tuplification of DOM Eric Botcazou
2011-06-28 22:18 ` Jeff Law
2011-06-29  7:32 ` Hans-Peter Nilsson
2011-06-29  9:38 ` Richard Guenther
2011-06-30 20:47 ` Eric Botcazou

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